- 1
http://1c.ru/news/info.jsp?id=21537
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−99
http://1c.ru/news/info.jsp?id=21537
ну не вирус конечно, но первый дропер на 1С
+2
#define QVERIFY2(statement, description) \
do {\
if (statement) {\
if (!QTest::qVerify(true, #statement, (description), __FILE__, __LINE__))\
return;\
} else {\
if (!QTest::qVerify(false, #statement, (description), __FILE__, __LINE__))\
return;\
}\
} while (0)
Код из QTest либы Qt4.
+6
habrahabr.ru/post/113215/
Кодогенерируем вместе!
+10
final public function getCustomerKey()
{
return implode('', array_map('c'.'h'
.'r', explode('.', '53.51.50.52.49.51.50.50.49.51.102.100.50.57.55.54.101.54.56.51.51.57.102.55.53.102.49.57.100.54.49.98.51.51.49.56.99.53.57.48.57.49')
));
}
−3
[Wed Jun 01 10:13:25.866953 2016] [autoindex:error] [pid 30710] [client 77.222.112.203:24108] AH01276: Cannot serve directory /home/u325415/test.alpina-nerud.ru/www/: No matching DirectoryIndex (index.html,index.htm,index.php,index.php3,index.phtml,index.cgi,index.pl,index.shtml,default.htm,default.html) found, and server-generated directory index forbidden by Options directive
[Wed Jun 01 10:21:28.044222 2016] [autoindex:error] [pid 4437] [client 77.222.112.203:30432] AH01276: Cannot serve directory /home/u325415/test.alpina-nerud.ru/www/: No matching DirectoryIndex (index.html,index.htm,index.php,index.php3,index.phtml,index.cgi,index.pl,index.shtml,default.htm,default.html) found, and server-generated directory index forbidden by Options directive
[Wed Jun 01 10:28:39.825066 2016] [autoindex:error] [pid 10534] [client 77.222.112.203:36957] AH01276: Cannot serve directory /home/u325415/test.alpina-nerud.ru/www/: No matching DirectoryIndex (index.html,index.htm,index.php,index.php3,index.phtml,index.cgi,index.pl,index.shtml,default.htm,default.html) found, and server-generated directory index forbidden by Options directive
[Wed Jun 01 12:11:48.394301 2016] [:error] [pid 6058] [client 77.222.112.203:37192] PHP Warning: require(typo3/sysext/core/Classes/Core/Bootstrap.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/u325415/test.alpina-nerud.ru/www/index.php on line 48
[Wed Jun 01 12:11:48.394400 2016] [:error] [pid 6058] [client 77.222.112.203:37192] PHP Warning: require(typo3/sysext/core/Classes/Core/Bootstrap.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/u325415/test.alpina-nerud.ru/www/index.php on line 48
[Wed Jun 01 12:11:48.394426 2016] [:error] [pid 6058] [client 77.222.112.203:37192] PHP Fatal error: require() [<a href='function.require'>function.require</a>]: Failed opening required 'typo3/sysext/core/Classes/Core/Bootstrap.php' (include_path='.:/usr/share/php53:/usr/share/pear53') in /home/u325415/test.alpina-nerud.ru/www/index.php on line 48
[Wed Jun 01 12:18:39.840563 2016] [:error] [pid 12269] [client 77.222.112.203:15356] PHP Parse error: syntax error, unexpected T_CLASS in /home/u325415/test.alpina-nerud.ru/www/typo3conf/ext/chgallery/lib/class.tx_chgallery_tca.php on line 1, referer: http://test.alpina-nerud.ru/typo3/
[Wed Jun 01 12:18:42.839703 2016] [:error] [pid 12319] [client 77.222.112.203:15413] PHP Parse error: syntax error, unexpected T_CLASS in /home/u325415/test.alpina-nerud.ru/www/typo3conf/ext/chgallery/lib/class.tx_chgallery_tca.php on line 1
[Wed Jun 01 12:18:45.376653 2016] [:error] [pid 12333] [client 77.222.112.203:15456] PHP Parse error: syntax error, unexpected T_CLASS in /home/u325415/test.alpina-nerud.ru/www/typo3conf/ext/chgallery/lib/class.tx_chgallery_tca.php on line 1
[Wed Jun 01 12:19:02.624195 2016] [:error] [pid 12557] [client 77.222.112.203:15794] PHP Parse error: syntax error, unexpected T_CLASS in /home/u325415/test.alpina-nerud.ru/www/typo3conf/ext/chgallery/lib/class.tx_chgallery_tca.php on line 1
[Wed Jun 01 12:19:04.446064 2016] [:error] [pid 12573] [client 77.222.112.203:15826] PHP Parse error: syntax error, unexpected T_CLASS in /home/u325415/test.alpina-nerud.ru/www/typo3conf/ext/chgallery/lib/class.tx_chgallery_tca.php on line 1
[Wed Jun 01 12:20:25.263810 2016] [:error] [pid 13455] [client 77.222.112.203:17281] PHP Parse error: syntax error, unexpected T_CLASS in /home/u325415/test.alpina-nerud.ru/www/typo3conf/ext/chgallery/lib/class.tx_chgallery_tca.php on line 1
[Wed Jun 01 12:21:43.511456 2016] [:error] [pid 14762] [client 77.222.112.203:18648] PHP Parse error: syntax error, unexpected T_CLASS in /home/u325415/test.alpina-nerud.ru/www/typo3conf/ext/chgallery/lib/class.tx_chgallery_tca.php on line 1
[Wed Jun 01 12:21:54.006698 2016] [:error] [pid 14760] [client 77.222.112.203:18644] PHP Parse error: syntax error, unexpected T_CLASS in /home/u325415/test.alpina-nerud.ru/www/typo3conf/ext/chgallery/lib/class.tx_chgallery_tca.php on line 1
[Wed Jun 01 12:21:56.294966 2016] [:error] [pid 14894] [client 77.222.112.203:18855] PHP Parse error: syntax error, unexpected T_CLASS in /home/u325415/test.alpina-nerud.ru/www/typo3conf/ext/chgallery/lib/class.tx_chgallery_tca.php on line 1
[Wed Jun 01 12:22:11.178438 2016] [:error] [pid 15124] [client 77.222.112.203:19238] PHP Parse error: syntax error, unexpected T_CLASS in /home/u325415/test.alpina-nerud.ru/www/typo3conf/ext/chgallery/lib/class.tx_chgallery_tca.php on line 1
[Wed Jun 01 12:23:17.882880 2016] [:error] [pid 15798] [client 77.222.112.203:20386] PHP Warning: require(sysext/core/Classes/Core/Bootstrap.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/u325415/test.alpina-nerud.ru/www/typo3/init.php on line 55
[Wed Jun 01 12:23:17.882976 2016] [:error] [pid 15798] [client 77.222.112.203:20386] PHP Warning: require(sysext/core/Classes/Core/Bootstrap.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/u325415/test.alpina-nerud.ru/www/typo3/init.php on line 55
[Wed Jun 01 12:23:17.883003 2016] [:error] [pid 15798] [client 77.222.112.203:20386] PHP Fatal error: require() [<a href='function.require'>function.require</a>]: Failed opening required 'sysext/core/Classes/Core/Bootstrap.php' (include_path='.:/usr/share/php53:/usr/share/pear53') in /home/u325415/test.alpina-nerud.ru/www/typo3/init.php on line 55
Ошибка в логах
0
<?
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://maps.googleapis.com/maps/api/distancematrix/json?origins=Vancouver+BC&destinations=Seattle&mode=driving&language=de");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
$response = curl_exec($ch);
echo $response;
$array = json_decode($response, true);
echo $array["destination_addresses"];
?>
+1
public function timeDiff( $time, $now = null ) {
if ( ! is_int( $time ) )
$time = strtotime( (string) $time ) + ( get_option( 'gmt_offset' ) * 3600 - 10800 );
if ( is_null( $now ) )
$now = time();
if ( $now == $time )
return __( 'right now', Challonge_Plugin::TEXT_DOMAIN );
if ( $now < $time )
/* translators:
%s is an approximate relative amount of time (eg. "2 days")
*/
return sprintf( __( 'in %s', Challonge_Plugin::TEXT_DOMAIN ), human_time_diff( $time, $now ) );
/* translators:
%s is an approximate relative amount of time (eg. "2 days")
*/
return sprintf( __( '%s ago', Challonge_Plugin::TEXT_DOMAIN ), human_time_diff( $time, $now ) );
}
-10800
починил блять!
−100
ТекТаблицаСвойств = СсылкаНаОбьект.Свойства.Выгрузить().Скопировать(СсылкаНаОбьект.Свойства.НайтиСтроки(ТекОтбор));
Выгружаем строки из табличной части, используя отбор.
−2
this.params.IsCellEditable = function(rowNumber, cellNumber) {
cellNumber == 1;
this.params.ButtonList = this.params.ButtonList.filter(b=>b[0] === "OnRefresh");
let textContr = new CTextArea('textContr');
textContr.SourceName = "value";
textContr.ViewName = "Params";
textContr.ComEdit = true;
this.params.arrEditObj[1] = textContr;
}
Найдено в нашем проекте в старом модуле, в авторстве никто не признаётся.
Во-первых, строка 2 бессмысленна. Во-вторых, всё последующее имело бы хоть какой-то смысл _вне_ этой функции, а внутри уже на строке 3 выкидывает ошибку, потому что контекст там и есть this.param из первой строчки. В-третьих, строка 3 призвана выкидывать из тулбара виджета this.param все кнопки, кроме OnRefresh, но на самом деле она там только одна и есть. В-четвёртых, строчки 7 и 8 просто лишние (ну, это из логики используемого в проекте движка следует). В-пятых, из названия метода можно предположить (и это действительно так), что он должен бы возвращать булевское значение, но он всегда возвращает только undefined и, таким образом, все ячейки виджета оказываются нередактируемыми — что совсем лишает смысла создание контрола для редактирования в строках 5—9.
Редкостная бредятина. Кто-то в полном затмении писал, и даже десяти секунд не потратил на тестирование.
+1
<?
/*
Bitrix Cleaner v2.2 - https://github.com/creadome/bitrixcleaner
Быстрая очистка 1С-Битрикс
(c) 2015 Станислав Васильев - http://creado.me
[email protected]
*/
require $_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/prolog_admin_before.php';
$trash = array(
'cache' => array(
'/bitrix/cache/' => 'Неуправляемый кеш',
'/bitrix/managed_cache/' => 'Управляемый кеш',
'/bitrix/html_pages/' => 'HTML кеш'
),
'files' => array(
'/upload/resize_cache/' => 'Кеш изображений'
)
);
if ($_GET['clean']) {
BXClearCache(true);
$GLOBALS['CACHE_MANAGER']->CleanAll();
$GLOBALS['stackCacheManager']->CleanAll();
$staticHtmlCache = \Bitrix\Main\Data\StaticHtmlCache::getInstance();
$staticHtmlCache->deleteAll();
foreach ($trash['files'] as $files => $name) DeleteDirFilesEx($files);
}
function countsize($directory) {
$count = array('file' => 0, 'size' => 0);
foreach (scandir($directory) as $file) {
if ($file != '.' && $file != '..') {
if (is_dir($directory.$file)) {
$inner = countsize($directory.$file.'/');
$count['file'] += $inner['file'];
$count['size'] += $inner['size'];
} else {
$count['file'] ++;
$count['size'] += filesize($directory.$file);
}
}
}
return $count;
}
?>
<table>
<tr>
<th>Описание</th>
<th>Путь</th>
<th>Файлы</th>
<th>Размер</th>
</tr>
<?
foreach ($trash as $type) {
foreach ($type as $directory => $name) {
$count = countsize($_SERVER['DOCUMENT_ROOT'].$directory);
?>
<tr>
<td><?=$name?></td>
<td><a href="/bitrix/admin/fileman_admin.php?lang=ru&path=<?=$directory?>"><?=$directory?></a></td>
<td><?=$count['file']?></td>
<td><?=round($count['size'] / 1048576, 2)?> Мб</td>
</tr>
<?
}
}
?>
</table>
<input type="button" value="Очистить" class="adm-btn-save" data-action="clean">
Битрикс. порадовала строчка "'/bitrix/cache/' => 'Неуправляемый кеш'". Оказывается даже адептам битрикса не подвластно управление кешом самого битрикса :D
https://github.com/creadome/bitrixcleaner/blob/master/cleaner/cleaner.php