- 1
- 2
- 3
- 4
- 5
- 6
- 7
/**
 * @param string $singular
 * @param string $context
 */
function translate($singular, $context=null) {
	return $singular;
}Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+155
/**
 * @param string $singular
 * @param string $context
 */
function translate($singular, $context=null) {
	return $singular;
}Любимый вордпресс, wp-includes/pomo/translations.php. Кажется, это такой интерфейс.
+162
if(isset($_POST['submit']) AND $_POST['submit'] == 'add_program')
      {
         if($this->form_validation->run('add_program') == TRUE)
         {
            // Добавляем программу обучения
            $this->Settings_model->add_program($_POST['title']);
            $id = $this->db->insert_id();
            for ($x = 0; $x < 61; $x++)
            {
               if ($x <= 12) 
               {
                  $title = $x;
                  $year = 1;
               }
               elseif ($x > 12 AND $x <= 24) 
               {
                  if($x == 13) {$title = 1;}
                  if($x == 14) {$title = 2;}
                  if($x == 15) {$title = 3;}
                  if($x == 16) {$title = 4;}
                  if($x == 17) {$title = 5;}
                  if($x == 18) {$title = 6;}
                  if($x == 19) {$title = 7;}
                  if($x == 20) {$title = 8;}
                  if($x == 21) {$title = 9;}
                  if($x == 22) {$title = 10;}
                  if($x == 23) {$title = 11;}
                  if($x == 24) {$title = 12;}
                  $year = 2;
               }
               elseif ($x > 24 AND $x <= 36) 
               {
                  if($x == 25) {$title = 1;}
                  if($x == 26) {$title = 2;}
                  if($x == 27) {$title = 3;}
                  if($x == 28) {$title = 4;}
                  if($x == 29) {$title = 5;}
                  if($x == 30) {$title = 6;}
                  if($x == 31) {$title = 7;}
                  if($x == 32) {$title = 8;}
                  if($x == 33) {$title = 9;}
                  if($x == 34) {$title = 10;}
                  if($x == 35) {$title = 11;}
                  if($x == 36) {$title = 12;}
                  $year = 3;
               }
               elseif ($x > 36 AND $x <= 48) 
               {
                  if($x == 37) {$title = 1;}
                  if($x == 38) {$title = 2;}
                  if($x == 39) {$title = 3;}
                  if($x == 40) {$title = 4;}
                  if($x == 41) {$title = 5;}
                  if($x == 42) {$title = 6;}
                  if($x == 43) {$title = 7;}
                  if($x == 44) {$title = 8;}
                  if($x == 45) {$title = 9;}
                  if($x == 46) {$title = 10;}
                  if($x == 47) {$title = 11;}
                  if($x == 48) {$title = 12;}
                  $year = 4;
               }
               else
               {
                  if($x == 49) {$title = 1;}
                  if($x == 50) {$title = 2;}
                  if($x == 51) {$title = 3;}
                  if($x == 52) {$title = 4;}
                  if($x == 53) {$title = 5;}
                  if($x == 54) {$title = 6;}
                  if($x == 55) {$title = 7;}
                  if($x == 56) {$title = 8;}
                  if($x == 57) {$title = 9;}
                  if($x == 58) {$title = 10;}
                  if($x == 59) {$title = 11;}
                  if($x == 60) {$title = 12;}
                  $year = 5;
               }
               
               if($x != 0)
               {
                  // Добавляем месяцы обучения
                  $this->Settings_model->add_tutorial_months($id,$year,$title);
               }
            }Тяжело супортить чейто проект
+168
$salt = 'fghjghjfhjfjhnbvmnbmvhjgfgjh785678tyutyu76678xcvbxcvb67hdfghdfgh67e657ytryerty5674567ryerty6574567tryertye75467657trhgfbvnhmhkijiluiotyiueuwyertsdrgfhndhgjdtyuerghddjghjhgjfktryudghgfhrthrtdhgfhdtyerghfghrtyer74576ytreuyytu6756yertytryet756745yhhgfnmdfgsreyyrteu676584678677795785687ytujhgfnvgsgomsjgsfguhjhgsdfujsdfgpousgjpsihsgubsfug89e6w5hisfdgbsidfgh5467woaiybvsdfghewtuhrty90w465uiregthshuaert90wuitre97gfuhfsujghhntigfjhtkh90eruheiuhfdiuhtruhghrthr9ugfgijdfngifdgijfgnsdfghwe9065hutriosgdfojdfigodfhgeiurtwhe9057yer9tud9fsoiudfshgert9y435trhgfdiuhgsdiufghidfghfffff';
$hash = md5(sha1(md5(md5($salt . $oplata . $rnd . $summ . $time . $id . $kl . $magas . $xxtea . $salt) . $salt . $time . $id . $magas . $rnd) . $salt . $time . $id . $magas . $rnd) . $salt . $kl . $kl);
$hash = hash('sha512', $hash);
$hash = hash('whirlpool', $hash);
$hash = hash('ripemd320', $hash);
$hash = hash('haval256,5', $hash);
$hash = hash('ripemd320', $hash);
$hash = hash('snefru', $hash);
$hash = hash('crc32', $hash);
            Безопаснейший и неподбираемейший хэш =)
Оригинал тут: https://toster.ru/q/204698
        
+160
$Result = MySQL_Query("SELECT name FROM users WHERE name='$Login'") or ("Can't execute query.");
                
if (MySQL_Num_Rows($Result))
{
          echo "Account <b>".$Login."</b> is exists";
}
...
elseif ((StrLen($Pass) < 4) or (StrLen($Pass) > 10)) 
{
echo "Password must have more 4 and not more 10 symbols.";
}
elseif ((StrLen($Repass) < 4) or (StrLen($Repass) > 10)) 
{
echo "Repeat password must have more 4 and not more 10 symbols.";
}
elseif ((StrLen($Email) < 4) or (StrLen($Email) > 25)) 
{
echo "Email must have more 4 and not more 25 symbols.";
}
elseif ($Pass != $Repass)
{
echo "Password mismatch.";
}Фрагмент регистрации из кода сайта MMO игры. Видимо die забыли и в итоге вся проверка фтопку. Так же там педантично кроме проверки несовпадения введенных паролей оба проверяют на длину и содержание символов (это еще можно описать заботой о юзвере).
+159
$home = $jsClass = $benchmark = $showAtom = $mainJS = $author = $update = $nameError = $mailError = $msgError = $slugError = $spamError = $codeError = $codeTitleError = $titleError = $error = $author = $authorEmail = $authorURL = $ga = $embed = $noIndex = false;
            Зачем?
Отсюда:
https://github.com/mathiasbynens/jsperf.com/blob/master/index.php#L25
        
+159
string http_build_url ([ mixed $url [, mixed $parts [, int $flags = HTTP_URL_REPLACE [, array &$new_url ]]]] )
Parameters
    url
    (part(s) of) an URL in form of a string or associative array like parse_url() returns
    parts
    same as the first argumentволшебно
+159
$this->vars['cookie_domain'] = $this->vars['cookie_domain'] == "" ? ""  : $this->vars['cookie_domain'];
            Из IPB от 2007 года, по следам индусского неизвестного классика.
Если cookie_domain = "", то пусть будет "", а если нет, то и хуй с ним, пусть остается как есть.
        
+159
if (1) {
define("IMGBASE","");
define("IMGNUM","");
} else {
define("IMGBASE","imgs");
define("IMGFN","_rm");
}Может я плохой программист, а это не говнокод??? Но таких условий в проекте миллионы блядь!
+158
<?php
//ключ для xxtea
                $sekret = mt_rand(1,99999999999999);
        
//фальшыфка для get :D пускай тру хакеры помучаются пару недель :D
                $sol = mt_rand (1, 9999999);
                $iid = mt_rand (1, 900);
                $iid = md5($sol.$iid.sha1($sekret.$iid).md5($sol.$iid));
                $dan = base64_encode($iid);
                $dan = md5($sol.$iid.$dan.sha1($sekret.$iid.$dan).md5($sekret.$iid.$dan));
//шифровка ключа который делает розшыфровку :D знаю что  так надёжние :D :D
                $pi = mt_rand (1, 5);
                $delitil = mt_rand (1, 10);            
                $mnogitel = mt_rand (1, 15);
                $dodan = mt_rand (1, 20);
                $mn = mt_rand (1, 25);
                $mn1 = mt_rand (1, 50);
                $procent = mt_rand (1, 5);
                $procent= $sekret / $procent;
                $sekret = $sekret * $mn / $pi;         
                $pq = $sekret / $delitil;
                $pw = $pq /$procent;
                $output = $pw * $mnogitel ;
                $otv = $output + $dodan * $mn1;
//розшыфровка ключа
$otv = $output / $mn1 - $dodan;
$sekret =$output * $procent * $delitil / $mnogitel /$mn * $pi;https://toster.ru/q/204286
+159
/**
 * @package mod_jlcurrency
 * @author Zhukov Artem ([email protected])
 * @version 1.1
 * @copyright (C) 2012 by JoomLine (http://www.joomline.net)
 * @license GNU/GPL: http://www.gnu.org/copyleft/gpl.html
 *
*/
// No direct access
defined('_JEXEC') or die('Restricted access');
$vl = array();
$vl[$params->get('JPY')]=$params->get('JPY');$vl[$params->get('ZAR')]=$params->get('ZAR');
$vl[$params->get('KRW')]=$params->get('KRW');$vl[$params->get('CHF')]=$params->get('CHF');
$vl[$params->get('SEK')]=$params->get('SEK');$vl[$params->get('CZK')]=$params->get('CZK');
$vl[$params->get('UAH')]=$params->get('UAH');$vl[$params->get('UZS')]=$params->get('UZS');
$vl[$params->get('TRY')]=$params->get('TRY');$vl[$params->get('TMT')]=$params->get('TMT');
$vl[$params->get('TJS')]=$params->get('TJS');$vl[$params->get('SGD')]=$params->get('SGD');
$vl[$params->get('XDR')]=$params->get('XDR');$vl[$params->get('RON')]=$params->get('RON');
$vl[$params->get('PLN')]=$params->get('PLN');$vl[$params->get('NOK')]=$params->get('NOK');
$vl[$params->get('MDL')]=$params->get('MDL');$vl[$params->get('LTL')]=$params->get('LTL');
$vl[$params->get('LVL')]=$params->get('LVL');$vl[$params->get('CNY')]=$params->get('CNY');
$vl[$params->get('KGS')]=$params->get('KGS');$vl[$params->get('CAD')]=$params->get('CAD');
$vl[$params->get('KZT')]=$params->get('KZT');$vl[$params->get('INR')]=$params->get('INR');
$vl[$params->get('EUR')]=$params->get('EUR');$vl[$params->get('USD')]=$params->get('USD');
$vl[$params->get('DKK')]=$params->get('DKK');$vl[$params->get('HUF')]=$params->get('HUF');
$vl[$params->get('BRL')]=$params->get('BRL');$vl[$params->get('BGN')]=$params->get('BGN');
$vl[$params->get('BYR')]=$params->get('BYR');$vl[$params->get('AMD')]=$params->get('AMD');
$vl[$params->get('GBP')]=$params->get('GBP');$vl[$params->get('AZN')]=$params->get('AZN');
$vl[$params->get('AUD')]=$params->get('AUD');Эмм. Это так и должно быть?