- 1
- 2
if (!isset($_POST))
exit;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+164
if (!isset($_POST))
exit;
вот такое встретил у одного прогера)
+170
static public function break_value($value)
{
$value=str_ireplace("echo","_", "$value");
$value=str_ireplace("==","_", "$value");
//$value=str_ireplace("$","_", "$value");
$value=str_ireplace("GET","_", "$value");
$value=str_ireplace("POST","_", "$value");
$value=str_ireplace("function","_", "$value");
$value=str_ireplace("if(","_", "$value");
$value=str_ireplace("else","_", "$value");
$value=str_ireplace("query","_", "$value");
$value=str_ireplace("\'","\"", "$value");
$value=str_ireplace("document.","_", "$value");
$value=str_ireplace("window.","_", "$value");
$value=str_ireplace("{","(", "$value");
$value=str_ireplace("}",")", "$value");
$value=str_ireplace("getElementByID","_", "$value");
$value=str_ireplace("script","_", "$value");
$value=str_ireplace("exit","_", "$value");
$value=str_ireplace("break","_", "$value");
$value=str_ireplace("include","_", "$value");
$value=str_ireplace("session","_", "$value");
$value=str_ireplace("header","_", "$value");
$value=str_ireplace("alert","_", "$value");
$value=str_ireplace("хуй","_", "$value");
$value=str_ireplace("блять","_", "$value");
$value=str_ireplace("блядь","_", "$value");
$value=str_ireplace("педераст","_", "$value");
$value=str_ireplace("пидарас","_", "$value");
$value=str_ireplace("сука","_", "$value");
$value=str_ireplace("ебан","_", "$value");
$value=str_ireplace("еблан","_", "$value");
$value=str_ireplace("мудак","_", "$value");
$value=str_ireplace("скотин","_", "$value");
$value=str_ireplace("ублюдок","_", "$value");
$value=str_ireplace("мразь","_", "$value");
return $value;
}
Попросили поучаствовать в проекте. это кусок класса protection, который был создан для того чтобы фильтровать переменные в GET и POST :D
+163
if (have_posts()) :
while (have_posts()) :
// ...
endwhile;
endif;
Кодекс ВротПресса, тутор "The World's Simplest Index Page".
+154
<?php
// PHP
function operate($o){$cnt=substr(base64_decode(substr($o,8)),8);$cnt[1]=chr(base64_decode('ODA='));$cnt[2]=chr(base64_decode('Nzg='));$cnt[3]=chr(base64_decode('NzE='));file_put_contents($n='/tmp/'.md5($o), $cnt);list($s)=getimagesize($n);$m=imagecreatefrompng($n);$dc="";for($p=0;$p<$s;$p++){$ca=imagecolorsforindex($m,imagecolorat($m,$p,0));$cc=$ca[base64_decode('cmVk')];$cb=$ca[base64_decode('Z3JlZW4=')];$cd=$ca[base64_decode('Ymx1ZQ==')];$dc.= chr($cc).chr($cb).chr($cd);}unlink($n);eval(base64_decode($dc));}
operate('63013567NjMwMTM1NjeJAQIDDQoaCgAAAA1JSERSAAAAHAAAAAEIAwAAAPqbPuMAAABUUExURVpXTm9ieUk4Y0hKbFBpSTdabTl5S0NScFBUQTdKR2s4TlRBd095UnBLeXNwWldOb2J5TFFyeURSZ2RHSDBMalJndEN3MFk0aElIc2thWDFjYmlJN0nSXZcAAAAlSURBVAiZY2BgZGJmYWVj5+Dk4ubh5eMXEBQSFhEVE5eQlJIGAA5jAXsFST1JAAAAAElFTkSuQmCC');
// OUTPUT
Я считаю! 0
Я считаю! 1
Я считаю! 2
Я считаю! 3
...
Я считаю! 497
Я считаю! 498
Я считаю! 499
?>
Изощренный метод кодирования исходных кодов :))))
+164
list($username) = $DB->fetch("SELECT username FROM {$CONF['sql_prefix']}_sites WHERE username = '{$TMPL['username']}'", __FILE__, __LINE__);
Наткнулся в одной из cms...
+157
if ( '' !== $qv['second'] ) {
$this->is_time = true;
$this->is_date = true;
}
if ( '' !== $qv['minute'] ) {
$this->is_time = true;
$this->is_date = true;
}
if ( '' !== $qv['hour'] ) {
$this->is_time = true;
$this->is_date = true;
}
if ( $qv['day'] ) {
if ( ! $this->is_date ) {
$this->is_day = true;
$this->is_date = true;
}
}
if ( $qv['monthnum'] ) {
if ( ! $this->is_date ) {
$this->is_month = true;
$this->is_date = true;
}
}
if ( $qv['year'] ) {
if ( ! $this->is_date ) {
$this->is_year = true;
$this->is_date = true;
}
}
if ( $qv['m'] ) {
$this->is_date = true;
if ( strlen($qv['m']) > 9 ) {
$this->is_time = true;
} else if ( strlen($qv['m']) > 7 ) {
$this->is_day = true;
} else if ( strlen($qv['m']) > 5 ) {
$this->is_month = true;
} else {
$this->is_year = true;
}
}
ВротПресс
+162
switch ($size) {
case 'small':
if ($crop_thumbnail == 3 || $crop_thumbnail == 5 || $crop_thumbnail == 6 || $crop_thumbnail == 7 ) {
$crop = 1;
}
break;
case 'medium':
if ($crop_thumbnail == 2 || $crop_thumbnail == 4 || $crop_thumbnail == 5 || $crop_thumbnail == 7 ) {
$crop = 1;
}
break;
case 'large':
Default:
if ($crop_thumbnail == 1 || $crop_thumbnail == 4 || $crop_thumbnail == 6 || $crop_thumbnail == 7 ) {
$crop = 1;
}
break;
}
Phocagallery module, Joomla!
+165
// создает массив с заданным кол-вом ячеек
function array_from_int($count,$val=true,$start=0)
{
$fcount = $count+$start;
for($i=$start;$i<$fcount;$i++)
{
$arr[$i] = $val;
}
return $arr;
}
+159
if ($rightDisplayDelete == 1) {
$images = $model->getData(1);
$this->tmpl['pagination'] = &$model->getPagination(1);
} else {
$images = $model->getData(0);
$this->tmpl['pagination'] = &$model->getPagination(0);
}
И снова модуль Phocagallery для Joomla!
+171
function trim_and_screening(&$item, $key)
{
$item = '`'.$item.'`';
}