- 1
if ($invitationType == '1' || '2') {}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+10
if ($invitationType == '1' || '2') {}
Indian validation. WHYYYYY?
+8
//как создать сильный пароль в php
$hp = md5(md5(md5(strong($_POST['hp'])))); // типо наш пароль
//а что же такое strong??
###############################
######## Фильтрация ###########
###############################
function strong($msg){
$msg = trim($msg);
$msg = htmlspecialchars($msg);
$msg = mysql_escape_string($msg);
return $msg;
}
Мануал по шифрованию паролей.
+3
###############################
##### Проверяем сылку гет #####
###############################
foreach ($_GET as $links) {
if (!is_string($links) || !preg_match('#^(?:[a-z0-9_\-/]+|\.+(?!/))*$#i', $links)) {
header ('Location: '.$HOME.'');
exit;
}
}
unset($links);
Защита с strongcms v.1.1 . Офф сайт strongcms.ru
---
P.s. продам такую же защиту на $_POST данные ))
+2
//-----Если жмут submit(кнопку)-----//
if(isset($_REQUEST['reg']))
Really ? :D
+5
$sql = mysql_query("SELECT * FROM `news` ORDER BY `id` DESC LIMIT 1");
while($sql1 = mysql_fetch_assoc($sql))
{
echo ''.smile(bb($sql1['text'])).'<br />
Добавил: '.nick($sql1['avtor']).'<br />
<a href="/news/comment'.$sql1['id'].'">Комментарии:</a> ('.mysql_result(mysql_query('select count(`id`) from `news_com` where `news` = "'.$sql1['id'].'"'),0).')';
if($user['id']) {
echo '<br /><a href="?news='.$sql1['id'].'">Скрыть новость</a>';}
if(isset($_GET['news']))
{
$news= trim(intval($_GET['news']));
mysql_query("UPDATE `users` SET `news` = '".$news."' WHERE `id` = '".$user['id']."'");
header('Location: '.$HOME.'');
}
}
Исходники супер сильной cms 2016 ! Встречайте StrongCMS! Версия движка 1.1. Скачать можно на strongcms.ru :)
+1
header.php
<?$APPLICATION->IncludeComponent(
"lenal:lenal.menu",
"mobile",
array(
"VIEW_MODE" => "LINE",
"SHOW_PARENT_NAME" => "Y",
"IBLOCK_TYPE" => "catalog",
"IBLOCK_ID" => "39",
"SECTION_ID" => $_REQUEST["SECTION_ID"],
"SECTION_CODE" => "",
"SECTION_URL" => "",
"COUNT_ELEMENTS" => "N",
"TOP_DEPTH" => "1",
"SECTION_FIELDS" => array(
0 => "",
1 => "",
),
"SECTION_USER_FIELDS" => array(
0 => "UF_MOST_POPULAR",
1 => "",
),
"ADD_SECTIONS_CHAIN" => "Y",
"CACHE_TYPE" => "A",
"CACHE_TIME" => "36000000",
"CACHE_GROUPS" => "Y",
"COMPONENT_TEMPLATE" => "ds_main_menu",
"MAX_COUNT" => "12",
"MAX_ACTIONS" => "4",
"MAX_POPULAR" => "5"
),
false
);?>
/**************************************************************/
component.php
if(!isset($arParams["CACHE_TIME"]))
$arParams["CACHE_TIME"] = 36000000;
if($this->StartResultCache(false, ($arParams["CACHE_GROUPS"]==="N"? false: $USER->GetGroups())))
{
if(!\Bitrix\Main\Loader::includeModule("iblock"))
{
$this->AbortResultCache();
ShowError(GetMessage("IBLOCK_MODULE_NOT_INSTALLED"));
return;
}
/**************************************************************/
В параметрах стоит "SECTION_ID" => $_REQUEST["SECTION_ID"] и единственным условием сброса кеша ("CACHE_TIME" => "36000000") является отсутствие одного из основных модулей.
Результат: по 99 460 файлов кеша на каждый сайт. И это - простое МЕНЮ.
Производство компания Lenal, платформа 1С-Битрикс
0
header.php
<?$APPLICATION->IncludeComponent(
"lenal:lenal.menu",
"mobile",
array(
"VIEW_MODE" => "LINE",
"SHOW_PARENT_NAME" => "Y",
"IBLOCK_TYPE" => "catalog",
"IBLOCK_ID" => "39",
"SECTION_ID" => $_REQUEST["SECTION_ID"],
"SECTION_CODE" => "",
..................................................
component.php
if(!isset($arParams["CACHE_TIME"]))
$arParams["CACHE_TIME"] = 36000000;
if($this->StartResultCache(false, ($arParams["CACHE_GROUPS"]==="N"? false: $USER->GetGroups())))
{
/*
* Lenal вы гребаные идиоты, у вас в параметрах стоит "SECTION_ID" => $_REQUEST["SECTION_ID"] и
* единственным условием у вас сброса кеша ("CACHE_TIME" => "36000000"!!!!!! бля)
* ВОТ ЭТО?! Отсутствие модуля iblock ?!?
* Чтоб вы всю жизнь на жевачку работали, придурки!
*
* 100 000 файлов кеша на ОДНО МЕНЮ ОДНОГО САЙТА!
*
* Дегенераты.
*
*/
if(!\Bitrix\Main\Loader::includeModule("iblock"))
{
$this->AbortResultCache();
ShowError(GetMessage("IBLOCK_MODULE_NOT_INSTALLED"));
return;
}
/*********************
Компонент меню на публичной части от компании Lenal (платформа 1С-Битрикс)
+3
public function payredirectAction() {
// Здесь еще какие-то манипуляции с $url
// и отключение view
echo "<script>window.location.href='" . $url . "';</script>";
}
Индусский редирект
Код на Zend_Framework 1.12
+6
$query_list_builder = array(
'1000' => " and account = $account_id and creator = $creator_id",
'0100' => " and account = $account_id and salepoint = $salepoint_id and creator <> $creator_id ",
'0010' => " and account = $account_id and creator <> $creator_id and salepoint <> $salepoint_id ",
'0001' => " and account IN ($watchlist) and creator <> $creator_id and salepoint <> $salepoint_id and account <> $account_id ",
'1100' => " and salepoint = $salepoint_id or creator = $creator_id and account = $account_id ",
'1010' => " and account = $account_id and salepoint <> $salepoint_id or creator = $creator_id ",
'1001' => " and account IN ($watchlist) and account <> $account_id or creator = $creator_id ",
'1110' => " and account = $account_id or creator = $creator_id and salepoint = $salepoint_id ",
'1101' => " and account IN ($watchlist) and account <> $account_id or creator = $creator_id or salepoint = $salepoint_id ",
'1111' => " and account IN ($watchlist) or account = $account_id or creator = $creator_id or salepoint = $salepoint_id ",
'0000' => " and creator <> $creator_id and salepoint <> $salepoint_id and account NOT IN ($watchlist) ",
'0011' => " and account IN ($watchlist) and salepoint <> $salepoint_id and creator <> $creator_id ",
'0111' => " and account IN ($watchlist) and creator <> $creator_id ",
'0110' => " and account = $account_id and creator <> $creator_id ",
'0101' => " and account IN ($watchlist) and account <> $account_id or salepoint = $salepoint_id and creator <> $creator_id ",
'1011' => " and account IN ($watchlist) and salepoint <> $salepoint_id or creator = $creator_id ",
);
+2
$do_while = DateTime::createFromFormat('d.m.Y H:i:s', $rowRequest['start_date'].":00");
$do_while = $do_while->format('U');
$do_while +=0;
list($hour , $minute ) = explode(":", "24:00");$hour +=0;$minute +=0;
$do_while +=($hour*3600 + $minute*60);
$time = date('d.m.Y H:i',$do_while);