- 1
- 2
- 3
- 4
public function defaultAction() {
        set_time_limit(1200);
        ini_set('memory_limit','4096M');	// 5 GbНашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
Всего: 8
+2
public function defaultAction() {
        set_time_limit(1200);
        ini_set('memory_limit','4096M');	// 5 GbСунь-цзы -- искусство военного обмана
+128
<style type="text/css">
<!--
body,html {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	padding: 0px;
}
-->
</style>
<body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0">Source: http://www.letsturnthisfuckingwebsiteyellow.com/
+160
$price = 'Sold!!!';
if ( $row['mail_sent'] != 1 ) {
	$price = 'Price: <span style="color:#bb6600;font-weight:bold;"> '.$row['price'].' </span> Euro';
}
echo '<br />';
printf ('%s',$price);
echo '<br />';Паранойя?
+161
if($total>1) {
    Error_Reporting(E_ALL & ~E_NOTICE);
    echo "<tr><td colspan='4'><div align='center'> <br />";
    echo $pervpage.$page5left.$page4left.$page3left.$page2left.$page1left.'<b>'.$p.'</b>'.$page1right.$page2right.$page3right.$page4right.$page5right.$nextpage;
    echo "</div></tr></td>";
}И это все к конце скрипта
+160
$id = $_POST['id'];
//$id = 194;
$temp = $id;
$str = "";
for ( $incr = 0; $incr < 100; $incr++ ) {
	$result = $dbs -> query("SELECT * FROM 
								market_categs 
							WHERE 
								categid={$temp} AND 
								published = 1 AND 
								status = 1");
	if ( mysql_num_rows($result) > 0 ) {
		$categ = mysql_fetch_array($result);
		$result2 = $dbs -> query("SELECT * FROM 
									market_categs_trans 
								WHERE 
									categid={$categ[categid]}");
		$categ_title = mysql_fetch_array( $result2 );
		$str2 = "";
		$temp2 = $categ[categid];
		for ( $incr2 = 0; $incr2 < 100; $incr2++ ) {
			$result3 = $dbs -> query("SELECT * FROM 
										market_categs 
									WHERE 
										categid={$temp2} AND 
										published = 1 AND 
										status = 1");
			if ( mysql_num_rows($result3) > 0 ) {
				$categ2 = mysql_fetch_array($result3);
				$str2 .= "/".$categ2[url];
				$temp2 = $categ2[parent];
			}
		}
		$str2 = substr($str2,1);
		$nb2 = substr_count($str2,"/");
		$temp_str2 = explode ("/",$str2);
		$str2 = "";
		$back = "";
		for ($i2 = $nb2; $i2 >= 0; $i2--) {
			$str2 .="/".$temp_str2[$nb2];
			$nb2--;
		}
		$str .= " / <a href='/".substr($str2,1)."'>".$categ_title[title]."</a>";
		$temp = $categ[parent];
	}
}Рекурсия... мать его
+169
// Конструктор
[...]
$this->Messages = array(
        1 => 'Card succesfull edited !',
        2 => 'Error, edited card !',
        3 => 'Was change succesfull.', // Тут индекс = 3
        4 => 'Was change succesfull.', // А тут = 4. Сечешь разницу?
        5 => 'Change status...',
        6 => 'Comment added succesful',
        7 => 'Comment expediated !', // Коммент ушел в экспедицию 
        8 => 'The card was droped succesgul.', // succesGul
        9 => 'Can\'t to delete this card.', // I don't to know php and to have no idea about english
        10 => 'Can\'t do upload file.',
        11 => 'File was uploaded successful.',
        12 => 'The eacuation was succesfull.', // Успешная эякуляция :O
        13 => 'Eacuation !' // Эякуляция !
    );
[...]
// Сохранение в базу
// - Папа, папа, а SQL Injection существует? - Нет сынок..........
$this->SUA_DB->query("INSERT INTO cards SET type='{$_POST['selector_type']}',name='{$_POST['card']}',user = '{$this->user_id}', description='{$_POST['descr']}', project='{$_POST['selector_project']}', category='{$_POST['selector_category']}' ") &
$this->Msg->SetMsg (vsprintf($this->Messages[7],$_POST['card'])) :
$this->Msg->SetMsg ($this->Messages[6]) &
$this->Msg->SetError(true);
// Из область фантастики
            Сказали чинить код парня которого недавно уволили... Пришлось переписать все заново.
Особенно понравившиеся строки прокомментировал
        
+170
// convert ',' to '.'
public static function ConvertDecimal($num) {
	$num = preg_replace('/,/i', '.', $num);
	//check if is number after convertion
	if (is_numeric($num))
		return $num;
	return false;
}у автора было суровое детство
+164
$pbase_url = parse_url($base_url);
if ( $pbase_url ){
    $base_url =  (parse_url($base_url, PHP_URL_SCHEME)? parse_url($base_url, PHP_URL_SCHEME).'://' : '')
                .(parse_url($base_url, PHP_URL_USER)? parse_url($base_url, PHP_URL_USER).':' : '')
                .(parse_url($base_url, PHP_URL_PASS)?parse_url($base_url, PHP_URL_PASS).'@' : '')
                .(string)parse_url($base_url, PHP_URL_HOST)
                .(string)parse_url($base_url, PHP_URL_PATH);
}...