1. PHP / Говнокод #648

    +144

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    debian:/home/molen# compiz --replace --fast-filter
    Checking for Xgl: not present. 
    No whitelisted driver found
    aborting and using fallback: /usr/bin/metacity 
    metacity: Unknown option --fast-filter

    1

    guest, 03 Марта 2009

    Комментарии (0)
  2. PHP / Говнокод #647

    +181.5

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    function replace_rus($str){
       $str = str_replace("а","|",$str);
       $str = str_replace("б","|",$str);
       $str = str_replace("в","|",$str);
       $str = str_replace("г","|",$str);
       $str = str_replace("д","|",$str);
       $str = str_replace("е","|",$str);
       $str = str_replace("ё","|",$str);
       $str = str_replace("ж","|",$str);
       $str = str_replace("з","|",$str);
       $str = str_replace("и","|",$str);
       $str = str_replace("й","|",$str);
       $str = str_replace("к","|",$str);
       .......
       .......
    }
    
    $bak = replace_rus($nickname);
    
    if(!preg_match("!^[@\\*\\)\\(\\?\\!\\-_\\]\\|\\[=~]+$!i",$bak)){
    
    говорит что недопустимые символы )

    Проверка на допустимые символы =)) автор заменяет все разрешенные символы на палочки, а потом регуляркой смотрит, есть ли в строке чтонибудь помимо палочек ))

    guest, 03 Марта 2009

    Комментарии (7)
  3. PHP / Говнокод #645

    +132

    1. 1
    2. 2
    3. 3
    4. 4
    /**
    *  "КАК БЫ сделал и ВРОДЕ БЫ работает."
    *
    **/

    Типичный отчёт говнокодера.

    guest, 02 Марта 2009

    Комментарии (4)
  4. PHP / Говнокод #644

    +150

    1. 1
    2. 2
    3. 3
    if (is_null($a)) return 'null';
    if ($a === false) return 'false';
    if ($a === true) return 'true';

    Не делайте так. Есть is_bool(), is_null(), or в конце концов.

    guest, 02 Марта 2009

    Комментарии (1)
  5. PHP / Говнокод #643

    +146

    1. 1
    2. 2
    3. 3
    function past_smiles ($name) {
      return "";
    }

    Оптимизированная функция добавления смайлов ;)

    guest, 02 Марта 2009

    Комментарии (4)
  6. PHP / Говнокод #642

    +150.2

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    function clear_danger_html ($string) {
    	$string = preg_replace ("#onclick=[\"|\'](.+?)[\"|\']#is", "", $string);
    	$string = preg_replace ("#onmouseover=[\"|\'](.+?)[\"|\']#is", "", $string);
    	$string = preg_replace ("#onmouseout=[\"|\'](.+?)[\"|\']#is", "", $string);
    	$string = preg_replace ("#onmousedown=[\"|\'](.+?)[\"|\']#is", "", $string);
    	$string = preg_replace ("#onmouseup=[\"|\'](.+?)[\"|\']#is", "", $string);
    	$string = preg_replace ("#onselect=[\"|\'](.+?)[\"|\']#is", "", $string);
    	$string = preg_replace ("#onfocus=[\"|\'](.+?)[\"|\']#is", "", $string);
    	$string = preg_replace ("#onblur=[\"|\'](.+?)[\"|\']#is", "", $string);
    	$string = preg_replace ("#onload=[\"|\'](.+?)[\"|\']#is", "", $string);
    	$string = preg_replace ("#onkeydown=[\"|\'](.+?)[\"|\']#is", "", $string);
    	$string = preg_replace ("#onkeyup=[\"|\'](.+?)[\"|\']#is", "", $string);
    	$string = preg_replace ("#ondblclick=[\"|\'](.+?)[\"|\']#is", "", $string);
    	$string = preg_replace ("#onunload=[\"|\'](.+?)[\"|\']#is", "", $string);
    	$string = preg_replace ("#onmouseup=[\"|\'](.+?)[\"|\']#is", "", $string);
    	$string = preg_replace ("#onsubmit=[\"|\'](.+?)[\"|\']#is", "", $string);
    	return $string;
    }

    Explay CMS

    guest, 02 Марта 2009

    Комментарии (0)
  7. PHP / Говнокод #640

    +159.6

    1. 1
    mysql_query("UPDATE `config` SET `lastdate`='".mysql_result(mysql_query("SELECT `lastdate` FROM `admin`;"),0)."';");

    guest, 02 Марта 2009

    Комментарии (4)
  8. PHP / Говнокод #639

    +151.7

    1. 1
    $result['name'] = mb_convert_encoding(ucfirst(mb_convert_encoding($result['name'], 'CP1251', 'UTF8')), 'UTF8', 'CP1251');

    ucfirst не работает с UTF-8, пришлось сделать так :)

    guest, 02 Марта 2009

    Комментарии (0)
  9. PHP / Говнокод #638

    +140

    1. 1
    2. 2
    3. 3
    4. 4
    <?php
    define ("CONST", "govno");
    while (CONST=="GOVNO") { echo '<a href="http://govnokod.ru">Govnokod</a><br>'; flush(); }
    ?>

    гыгыгыгыгыгы

    guest, 02 Марта 2009

    Комментарии (2)
  10. PHP / Говнокод #636

    +142

    1. 1
    2. 2
    3. 3
    <?php
    eval("echo 'Hello, world!'");
    ?>

    гомно =)

    guest, 01 Марта 2009

    Комментарии (1)