- 1
empty ( $php->p['h']{'p'}{'p'}['h']->p );
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+158
empty ( $php->p['h']{'p'}{'p'}['h']->p );
+161
if ($pathRelative && $relativePath) {
Взято из либы Google DFP
+142
public function GetSubscriptions()
{
return $this->repaymentPay->check();
}
А я сказал горбатый!
+155
try
{
return ($image = $this->row->image()->first())
? $image->{$this->imageAlias}
: dummyThumbnail($this->imageAlias)
;
}
catch(\Exception $e)
{
if ($e->getMessage() === 'Method [image] is not defined on the Query class.')
{
$val = parent::value();
return (is_string($val) and \Str::contains($val, 'http://'))
? $val
: $this->row->getImageSrc($this->name, $this->imageAlias)
;
}
throw new \Exception($e->getMessage(), $e->getCode());
}
+162
foreach ($foo as $key1=>$value) {
if ($foo[$key1][parent] == 0 ) {
echo '<li><a href="/index.php?cPath='.$key1.'">'.$foo[$key1][name].'</a>';
foreach ($foo as $key2=>$value) { if ($foo[$key2][parent] == $key1){echo '<ul>'; break; }};
foreach ($foo as $key2=>$value) {
if ($foo[$key2][parent] == $key1) {
echo '<li><a href="/index.php?cPath='.$key1.'_'.$key2.'">'.$foo[$key2][name].'</a>';
foreach ($foo as $key3=>$value) { if ($foo[$key3][parent] == $key2){echo '<ul>'; break;} };
foreach ($foo as $key3=>$value) {
if ($foo[$key3][parent] == $key2) {
echo '<li><a href="/index.php?cPath='.$key1.'_'.$key2.'_'.$key3.'">'.$foo[$key3][name].'</a>';
foreach ($foo as $key4=>$value) { if ($foo[$key4][parent] == $key3){echo '<ul>'; break;} };
foreach ($foo as $key4=>$value) {
if ($foo[$key4][parent] == $key3) {
echo '<li><a href="/index.php?cPath='.$key1.'_'.$key2.'_'.$key3.'_'.$key4.'">'.$foo[$key4][name].'</a>';
foreach ($foo as $key5=>$value) { if ($foo[$key5][parent] == $key4){echo '<ul>'; break;} };
foreach ($foo as $key5=>$value) {
if ($foo[$key5][parent] == $key4) {
echo '<li><a href="/index.php?cPath='.$key1.'_'.$key2.'_'.$key3.'_'.$key4.'_'.$key5.'">'.$foo[$key5][name].'</a>';
foreach ($foo as $key6=>$value) {if ($foo[$key6][parent] == $key5) {echo '<ul>'; break;} };
foreach ($foo as $key6=>$value) {
if ($foo[$key6][parent] == $key5) {
echo '<li><a href="/index.php?cPath='.$key1.'_'.$key2.'_'.$key3.'_'.$key4.'_'.$key5.'_'.$key6.'">'.$foo[$key6][name].'</a>';
}
}
foreach ($foo as $key6=>$value) { if ($foo[$key6][parent] == $key5){echo '</ul>'; break;} };
echo '</li>';
}
}
foreach ($foo as $key5=>$value) { if ($foo[$key5][parent] == $key4){echo '</ul>'; break;} };
echo '</li>';
}
}
foreach ($foo as $key4=>$value) {if ($foo[$key4][parent] == $key3) {echo '</ul>'; break;} };
echo '</li>';
}
}
foreach ($foo as $key3=>$value) { if ($foo[$key3][parent] == $key2){echo '</ul>'; break;} };
echo '</li>';
}
}
foreach ($foo as $key2=>$value) {if ($foo[$key2][parent] == $key1) {echo '</ul>'; break;} };
echo '</li>';
}
}
Правильное понимание рекурсии, привитое картинками вконтакте.
+165
if (($pos = strpos($_SERVER["REQUEST_URI"], "?")) !== false)
{
$params = substr($_SERVER["REQUEST_URI"], $pos+1);
parse_str($params, $_GET);
Bitrix, 404.php
Посоны не слышали про $_SERVER[QUERY_STRING], зато, сука, неймспейсы знают!
+121
//if they're locked out or banned die
if ( ( $bwpsoptions['id_enabled'] == 1 ||$bwpsoptions['ll_enabled'] == 1 ) && $this->checklock( $current_user->user_login ) ) {
wp_clear_auth_cookie();
@header( 'HTTP/1.0 418 I\'m a teapot' );
@header( 'Cache-Control: no-cache, must-revalidate' );
@header( 'Expires: Thu, 22 Jun 1978 00:28:00 GMT' );
die( __( 'error', $this->hook ) );
}
https://plugins.trac.wordpress.org/browser/better-wp-security/trunk/inc/secure.php#L925
+158
$result_max = mysql_query("SELECT MAX(id)+1 as max FROM cms_competition;");
$row_max = mysql_fetch_object($result_max);
if(!$row_max->max)
$row_max->max = 1;
Так ведь проще
+153
$db = new DB_Sql();
$db->connect();
$sql = "SELECT distinct(absnum) FROM articles";
$db->query($sql);
while ($db->next_record()){
$is_img_sql[] = $db->f('absnum');
}
$Open = opendir($_SERVER['DOCUMENT_ROOT'].'/img/forall/a/');
while(false !== ($gdir = readdir($Open))){
if($gdir != "." && $gdir != ".."){
$dir[] = $gdir;
}
}
closedir($Open);
foreach ($dir as $fdir){
if(is_dir($_SERVER['DOCUMENT_ROOT'].'/img/forall/a/'.$fdir.'/')){
$Open2 = opendir($_SERVER['DOCUMENT_ROOT'].'/img/forall/a/'.$fdir.'/');
while(false !== ($gdir2 = readdir($Open2))){
if($gdir2 != "." && $gdir2 != ".."){
$tmp = intval($fdir.ereg_replace("\..*","",$gdir2));
if(!in_array($tmp,$is_img_sql)){
$delfile = $_SERVER['DOCUMENT_ROOT'].'/img/forall/a/'.$fdir.'/'.$gdir2;
if (is_file($delfile)){
if (unlink($delfile)){
echo "Файл <b>".$delfile."</b> удален<br>";
}
}
}
}
}
closedir($Open2);
}
}
$Open = opendir($_SERVER['DOCUMENT_ROOT'].'/img/g/');
while(false !== ($gdirg = readdir($Open))){
if($gdirg != "." && $gdirg != ".."){
$dirg[] = $gdirg;
}
}
closedir($Open);
foreach ($dirg as $fdir){
$Open2 = opendir($_SERVER['DOCUMENT_ROOT'].'/img/g/'.$fdir.'/');
while(false !== ($gdir2 = readdir($Open2))){
if($gdir2 != "." && $gdir2 != ".."){
$tmp = intval($fdir.$gdir2.ereg_replace("\..*","",$gdir3));
if(!in_array($tmp,$is_img_sql)){
$delfile = $_SERVER['DOCUMENT_ROOT'].'/img/g/'.$fdir.'/'.$gdir2;
if (is_dir($delfile)){
$Opendel = opendir($delfile);
while(false !== ($gdirdel = readdir($Opendel))){
if($gdirdel != "." && $gdirdel != ".."){
$tpmdel = $delfile."/".$gdirdel;
if (is_file($tpmdel)){
unlink($tpmdel);
}
}
}
if (rmdir($delfile)){
echo "Директория <b>".$delfile."</b> удалена<br>";
}
}
}
}
}
closedir($Open2);
}
$sql = "SELECT distinct(absnum) FROM price";
$db->query($sql);
while ($db->next_record()){
$is_img_price[] = $db->f('absnum');
}
$Open = opendir($_SERVER['DOCUMENT_ROOT'].'/img/forall/p/');
while(false !== ($gdirp = readdir($Open))){
if($gdirp != "." && $gdirp != ".."){
$dirp[] = $gdirp;
}
}
closedir($Open);
foreach ($dirp as $fdir){
$Open2 = opendir($_SERVER['DOCUMENT_ROOT'].'/img/forall/p/'.$fdir.'/');
while(false !== ($gdir2 = readdir($Open2))){
if($gdir2 != "." && $gdir2 != ".."){
$tmp = intval($fdir.ereg_replace("\..*","",$gdir2));
if(!in_array($tmp,$is_img_price)){
$delfile = $_SERVER['DOCUMENT_ROOT'].'/img/forall/p/'.$fdir.'/'.$gdir2;
if (is_file($delfile)){
if (unlink($delfile)){
echo "Файл <b>".$delfile."</b> удален<br>";
}
}
}
}
}
+159
class CHTMLFormGenerator {
...
public $formName;
const formName = 'form';
function GetFormName() {
if(isset($this) && $this -> formName)
return $this -> formName;
else
return self::formName;
}
...
}