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

    +172

    1. 1
    2. 2
    if ( is_int(intval($_GET['y'])) ) {
      //...

    Lowezar, 22 Февраля 2012

    Комментарии (4)
  2. Куча / Говнокод #9514

    +110

    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
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    <!--
    			BEGIN RIDICULOUSLY LONG BATIK SECTION
    			
    			Do not touch. This is fragile stuff. Seriously.
    			
    			Batik just *wants* to pull xalan and xml-apis, *everywhere*,
    			even though we do not want this. And Ivy isn't clever enough
    			to ignore the dependencies everywhere.
    			
    			In an ideal world we would just explicitly depend on batik-swing
    			and batik-transcoder and be done with it. Instead we have to do
    			this atrocity. Apache, take a hint, would you kindly?
    		-->
    		<dependency org="org.apache.xmlgraphics" name="batik-xml" rev="[1.7,)">
    			<exclude org="xalan" module="xalan" />
    		</dependency>
    		<dependency org="org.apache.xmlgraphics" name="batik-ext" rev="[1.7,)">
    			<exclude org="xml-apis" module="xml-apis" />
    		</dependency>
    		<dependency org="org.apache.xmlgraphics" name="batik-css" rev="[1.7,)">
    			<exclude org="xml-apis" module="xml-apis" />
    		</dependency>
    		<dependency org="org.apache.xmlgraphics" name="batik-dom" rev="[1.7,)">
    			<exclude org="xml-apis" module="xml-apis" />
    		</dependency>
    		<dependency org="org.apache.xmlgraphics" name="batik-parser" rev="[1.7,)">
    			<exclude org="xml-apis" module="xml-apis" />
    		</dependency>
    		<dependency org="org.apache.xmlgraphics" name="batik-anim" rev="[1.7,)">
    			<exclude org="org.apache.xmlgraphics" module="batik-svg-dom" />
    			<exclude org="xml-apis" module="xml-apis" />
    		</dependency>
    		<dependency org="org.apache.xmlgraphics" name="batik-svg-dom" rev="[1.7,)">
    			<exclude org="xml-apis" module="xml-apis" />
    		</dependency>
    		<dependency org="org.apache.xmlgraphics" name="batik-bridge" rev="[1.7,)">
    			<exclude org="org.apache.xmlgraphics" module="batik-script" />
    			<exclude org="org.apache.xmlgraphics" module="batik-gvt" />
    			<exclude org="xml-apis" module="xml-apis" />
    			<exclude org="xalan" module="xalan" />
    		</dependency>
    		<dependency org="org.apache.xmlgraphics" name="batik-gvt" rev="[1.7,)">
    			<exclude org="org.apache.xmlgraphics" module="batik-script" />
    			<exclude org="xml-apis" module="xml-apis" />
    			<exclude org="xalan" module="xalan" />
    		</dependency>
    		<dependency org="org.apache.xmlgraphics" name="batik-gui-util" rev="[1.7,)">
    			<exclude org="xalan" module="xalan" />
    		</dependency>
    		<dependency org="org.apache.xmlgraphics" name="batik-script" rev="[1.7,)">
    			<exclude org="xalan" module="xalan" />
    		</dependency>
    		<dependency org="org.apache.xmlgraphics" name="batik-swing" rev="[1.7,)" />
    		<dependency org="org.apache.xmlgraphics" name="batik-transcoder" rev="[1.7,)" />
    		<!-- END BATIK SECTION -->

    Из ivy.xml.

    someone, 22 Февраля 2012

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

    +177

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    public static function textCorrections($text)
        {
            $text=str_replace("Ų", "Ø", $text);
            $text=str_replace("? фаски", "Ø фаски", $text);
            $text=str_replace("? отверстия", "Ø отверстия", $text);
            $text=str_replace("рем?нного", "ремённого", $text);
            return $text;
        }

    Вот такая заплатка для текстов в фомате UTF-8.

    Edd, 22 Февраля 2012

    Комментарии (2)
  4. C++ / Говнокод #9512

    +1009

    1. 1
    mExpanded = onExpandClick ? !mExpanded : mExpanded;

    lifemaker, 22 Февраля 2012

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

    +168

    1. 1
    2. 2
    3. 3
    $isHttp = $_tumbpath[0] == 'h' && $_tumbpath[1] == 't' && $_tumbpath[2] == 't' && $_tumbpath[3] == 'p';
    
    if ($isHttp){...}

    хорошо еще, что слово - http :)

    unVooDoo, 22 Февраля 2012

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

    +164

    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
    <script language="JavaScript">
                    <!--
                        document.write('<a href="#top" onclick="takeThis(\'<?php echo $PMA_Theme; ?>\'); return false;">');
                        document.write('<img src="<?php echo $screen_directory; ?>/screen.png" border="1" ');
                        if (document.getElementById) {
                            document.write('style="border: 1px solid #000000;" ');
                        }
                        document.write('alt="<?php echo htmlspecialchars(addslashes($theme_name)); ?>" ');
                        document.write('title="<?php echo htmlspecialchars(addslashes($theme_name)); ?>" />');
                        document.write('</a><br />');
                        document.write('[ <b><a href="#top" onclick="takeThis(\'<?php echo $PMA_Theme; ?>\'); return false;">');
                        document.write('<?php echo addslashes($strTakeIt); ?>');
                        document.write('</a></b> ]');
                    //-->
                    </script>

    Чужая самописная CMF. Файл themes в админке.

    zii, 22 Февраля 2012

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

    +155

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    public function get_included_js () 
     {
         if (count($this->included_js)) {
             return "\r\n".'<script type="text/javascript" src="'
             .implode('"></script>'."\r\n".'<script type="text/javascript" src="', $this->included_js)
             .'"></script>'."\r\n";
         } else {
             return '';
         }
     }

    Разгребаю чужой проект. Может быть чего-то не понимаю в этой жизни.

    zii, 22 Февраля 2012

    Комментарии (17)
  8. JavaScript / Говнокод #9508

    +150

    1. 1
    2. 2
    3. 3
    $('.form_gb textarea[name="vopros"]').val(replace_n($('.form_gb textarea[name="vopros"]').val()));//заменяем переводы строк на br
    var serialize_mas = $('.form_gb').serializeArray();
    $('.form_gb textarea[name="vopros"]').val(replace_br($('.form_gb textarea[name="vopros"]').val()));//заменяем br на переводы строк

    englandpost, 22 Февраля 2012

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

    +160

    1. 1
    2. 2
    $v2 = str_replace('\"', '"', $v2);
    $v2 = str_replace("\'", "'", $v2);

    no comments

    englandpost, 22 Февраля 2012

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

    +145

    1. 1
    2. 2
    3. 3
    4. 4
    <span>Выберите тип</span>
    <select>
        <option value="" selected="1">Все типы</option>
     </select>

    эт правда HTML... но тут нет такого раздела.. =(
    Чинил сайт, наткнулся на.. это.. О_о

    Zyets, 21 Февраля 2012

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