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

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    (Переслано со школьного чата)
    
    14.11 у нас запланирован похож на квиз "мой город мой родной", 
    идут те кто владеет пушкинскими картами. 
    
    Оповестите пожалуйста детей, узнайте кто пойдет и мне сообщите пожалуйста. 
    Те кто пойдет будут освобождены от занятий. 
    
    Ссылка для покупки билетов вот 
    https://vmuzey.com/event/moy-gorod-rodnoy
    1) ? $argv[1] : null; $cliRemoteAddr = (isset($argc)&&$argc > 2) ? $argv[2] : null; $user_agent = (isset($argc)&&$argc > 3) ? $argv[3]: null; $httpXForwarded For =

    вся суть российской бюрократии в одном сообщении

    и что это за код после ссылки? как это туда попало? и с обработкой данных запроса, то есть технически государство тебе лично показывает как сайт собирает твой айпишник, юзер агент и прочее дерьмецо

    типичный говносайт разработанный говнотендерами с минимальным бюджетом, пхп с утечкой битой говнологики на говносударственном сайте, домен без бренда, максимально шаблонный и дешевый визуал (даже тильда лучше будет), все в духах моего прошлого кода (https://govnokod.ru/29187, https://govnokod.ru/29188, https://govnokod.ru/29189)

    lisp-worst-code, 05 Ноября 2025

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

    +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
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    <?php
    function hsum($a, $b, $p) {
        $hs = $a ^ $b;
        $hp = $a & $b;
        $p <<= 1;
        return [$hs ^ $p, $hp | ($hs & $p)];
    }
    
    function hsum_rec($a, $b, $p) {
        list($s, $newp) = hsum($a, $b, $p);
        if ($newp == $p) {
            return [$s, $newp];
        } else {
            return hsum_rec($a, $b, $newp);
        }
    }
    
    function sum2($a, $b) {
        list($s, $p) = hsum_rec($a, $b, 0);
        return $s;
    }
    
    for($i = 0; $i < 16; $i++) {
        for($j = 0; $j < 16; $j++) {
            if(sum2($i,$j) != $i + $j) {
                $k = sum2($i,$j);
                echo "Error: $i, $j, $k\n";
            }
        }
    }

    Программа складывает два целых числа.

    Myxa, 08 Августа 2025

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

    +1

    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
    <?php
    function real_parse_headers($data) {
        $result = [];
        foreach($data as $line) {
            $parts = explode(':', $line, 2);
            if(!isset($parts[1])) continue;
            $key = trim($parts[0]);
            $key = implode('-', array_map(function($value) {return ucfirst($value);}, explode('-', $key)));
            $result[$key] = trim($parts[1]);
        }
        return $result;
    }
    
    function real_length($from, $original_context = null) {
        $context = stream_context_create(isset($original_context) ? stream_context_get_options($original_context) : null);
        stream_context_set_option($context, 'http', 'method', 'HEAD');
        @file_get_contents($from, false, $context);
        return intval(real_parse_headers($http_response_header)['Content-Length']);
    }
    
    function real_copy($from, string $to, $context = null) {
        define('BLOCK', 8192);
        $total = real_length($from, $context);
    
        if(!isset($context)) {
            $context = stream_context_create();
        }
        $headers = stream_context_get_options($context)['http']['header'] ?? [];
        stream_context_set_option($context, 'http', 'timeout', '1.0');
        stream_context_set_option($context, 'http', 'ignore_errors', true);
    
        for($start = 0; $start < $total; $start += $length) {
            $end = $start + BLOCK;
            stream_context_set_option($context, 'http', 'header', array_merge($headers, ["Range: bytes=$start-$end"]));
            $part = @file_get_contents($from, false, $context);
            if($part === false) break;
            $length = strlen($part);
            file_put_contents($to, $part, FILE_APPEND);
        }
    }
    
    /* The real example */
    $context = stream_context_create([
        'http' => ['method' => 'GET'],
        'ssl'  => ['verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true, 'SNI_enabled' => true]
    ]);        
    
    real_copy('https://govnokod.ru/files/images/pony.jpg', 'pony.jpg', $context);

    Дрочилка для скачивания файлов с сайтов, расположенных за «Cloudflare». Теперь банановая и на «PHP»!

    nemyx, 25 Июля 2025

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

    +1

    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
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    if (!$_pwd_trusted && $resto && $has_image && BOARD_DIR === 'g' && strpos($_thread_sub, '/aicg/') !== false) {
            $_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
            log_spam_filter_trigger('block_aicg', BOARD_DIR, $resto, $host, 1, $_bot_headers);
            error(S_IPRANGE_BLOCKED_IMG . ' ' . S_IPRANGE_BLOCKED_TEMP . S_IPRANGE_BLOCKED_L1);
          }
          
          if (!$_pwd_trusted && $resto && $has_image && BOARD_DIR === 'vg' && strpos($_thread_com, '/lolg/') !== false) {
            $_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
            log_spam_filter_trigger('block_lolg', BOARD_DIR, $resto, $host, 1, $_bot_headers);
            error(S_IPRANGE_BLOCKED_IMG . ' ' . S_IPRANGE_BLOCKED_TEMP . S_IPRANGE_BLOCKED_L1);
            //show_post_successful_fake($resto);
            //return;
          }
          
          if (!$_pwd_trusted && $resto && $has_image && BOARD_DIR === 'vg' && strpos($_thread_com, '/overwatch') !== false) {
            $_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
            log_spam_filter_trigger('block_owg', BOARD_DIR, $resto, $host, 1, $_bot_headers);
            error(S_IPRANGE_BLOCKED_IMG . ' ' . S_IPRANGE_BLOCKED_TEMP . S_IPRANGE_BLOCKED_L1);
            //show_post_successful_fake($resto);
            //return;
          }
          
          if (false && !$_pwd_trusted && $resto && $has_image && BOARD_DIR === 'fa' && strpos($_thread_sub, 'Workwear General') !== false) {
            $_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
            log_spam_filter_trigger('block_denim', BOARD_DIR, $resto, $host, 1, $_bot_headers);
            error(S_IPRANGE_BLOCKED_IMG . ' ' . S_IPRANGE_BLOCKED_TEMP . S_IPRANGE_BLOCKED_L1);
            //show_post_successful_fake($resto);
            //return;
          }
          
          if (!$_pwd_known && $resto && $has_image && BOARD_DIR === 'vg' && strpos($_thread_sub, '/bag/') !== false && $browser_id === '04d2237a2') {
            $_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
            log_spam_filter_trigger('block_bag', BOARD_DIR, $resto, $host, 1, $_bot_headers);
            error(S_IPRANGE_BLOCKED_IMG . ' ' . S_IPRANGE_BLOCKED_TEMP . S_IPRANGE_BLOCKED_L1);
          }
          
          if (false && !$_pwd_known && !$resto && (BOARD_DIR === 'co' || BOARD_DIR === 'a') && $country !== 'XX' && $browser_id === '02b99990d' && ($country == 'GB' || $country == 'DE' || $country == 'AU' || strpos($_COOKIE['_tcs'], $_SERVER['HTTP_X_TIMEZONE']) === false)) {
            $_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
            log_spam_filter_trigger('block_peridot', BOARD_DIR, $resto, $host, 1, $_bot_headers);
            error(S_IPRANGE_BLOCKED_IMG . ' ' . S_IPRANGE_BLOCKED_TEMP . S_IPRANGE_BLOCKED_L1);
          }
          
          if (!$_pwd_trusted && $resto && $has_image && BOARD_DIR === 'vg' && strpos($_thread_sub, 'granblue') !== false) {
            $_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
            log_spam_filter_trigger('block_gbfg', BOARD_DIR, $resto, $host, 1, $_bot_headers);
            error(S_IPRANGE_BLOCKED_IMG . ' ' . S_IPRANGE_BLOCKED_TEMP . S_IPRANGE_BLOCKED_L1);
            //show_post_successful_fake($resto);
            //return;
          }
          
          if (!$_pwd_known && $resto && $has_image && BOARD_DIR === 'v' && strpos($_thread_sub, 'gamesdonequick') !== false && $_threat_score >= 0.09 && mt_rand(0, 9) >= 1) {
            $_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
            log_spam_filter_trigger('block_adgq', BOARD_DIR, $resto, $host, 1, $_bot_headers);
            show_post_successful_fake($resto);
            return;
          }
          
          if (!$_pwd_known && $resto && $has_image && BOARD_DIR === 'vg' && strpos($_thread_sub, '/zzz/') !== false && $_threat_score >= 0.09 && mt_rand(0, 9) >= 1) {
            $_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
            log_spam_filter_trigger('block_zzz', BOARD_DIR, $resto, $host, 1, $_bot_headers);
            show_post_successful_fake($resto);
            return;
          }
          
          if (!$_pwd_verified && $resto && $has_image && BOARD_DIR === 'vg' && strpos($_thread_sub, '/funkg/') !== false && $_threat_score >= 0.09) {
            $_bot_headers = spam_filter_format_http_headers($com, $country, "$insfile$ext", $_threat_score, $_req_sig);
            log_spam_filter_trigger('block_funkg', BOARD_DIR, $resto, $host, 1, $_bot_headers);
            show_post_successful_fake($resto);
            return;
          }

    4chan.org. Хардкод бан. Продолжение https://govnokod.ru/29122.

    Админы, берите на заметку на свои форумы.

    trusted, known это проверки на число постов, связанных с куки+айпи.

    lemur, 22 Апреля 2025

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

    +1

    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
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    $css .= '<link rel="stylesheet" href="' . STATIC_SERVER . 'css/' . $mobilecss . '">';
    	
      // April 2024
      $css .= '<link rel="stylesheet" href="' . STATIC_SERVER . 'css/xa24extra.css">';
      
    	if (SHOW_COUNTRY_FLAGS) {
    		$css .= '<link rel="stylesheet" href="' . STATIC_SERVER . 'css/flags.' . CSS_VERSION_FLAGS . '.css">';
    	}
      
      if (ENABLE_BOARD_FLAGS) {
        $_flags_type = (defined('BOARD_FLAGS_TYPE') && BOARD_FLAGS_TYPE) ? BOARD_FLAGS_TYPE : BOARD_DIR;
        $css .= '<link rel="stylesheet" href="' . STATIC_SERVER . 'image/flags/' . $_flags_type . '/flags.' . CSS_VERSION_BOARD_FLAGS . '.css">';
      }
      
    	if( CODE_TAGS ) {
    		$css .= '<link rel="stylesheet" href="' . STATIC_SERVER . 'js/prettify/prettify.' . CSS_VERSION . '.css">';
    	}
    
    	// Various optional tags
    	if( USE_RSS == 1 ) {
    		$rss = '<link rel="alternate" title="RSS feed" href="/' . BOARD_DIR . '/index.rss" type="application/rss+xml">';
    	}
    
    	if( RTA == 1 ) {
    		$rta = '<meta name="rating" content="adult">';
    	}
    
    	if( defined( 'FAVICON' ) ) {
    		$favicon = '<link rel="shortcut icon" href="' . FAVICON . '">';
    	}
    	
    	$thread_unique_ips = 0;
    	$jsUniqueIps = '';
    	
    	if (SHOW_THREAD_UNIQUES) {
        if ($res) {
          $thread_unique_ips = get_unique_ip_count($res);
        }
        
        if ($thread_unique_ips) {
          $jsUniqueIps = 'var unique_ips = ' . $thread_unique_ips . ';';
        }
    	}
      
    	// js tags
    	$jsVersion   = TEST_BOARD ? JS_VERSION_TEST : JS_VERSION;
    	$comLen      = MAX_COM_CHARS;
    	$styleGroup  = style_group();
    	$maxFilesize = MAX_KB * 1024;
    	$maxLines    = MAX_LINES;
    	$jsCooldowns = json_encode(array(
    		'thread' => RENZOKU3,
    		'reply' => RENZOKU,
    		'image' => RENZOKU2
    	));
      
    	$tailSizeJs = '';
    	
      if ($res) {
        $tailSize = get_json_tail_size($res);
        
        if ($tailSize) {
          $tailSizeJs = ",tailSize = $tailSize";
        }
      }

    «Форчан» поломали.

    ISO, 15 Апреля 2025

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

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    for ($i = 0; $i < 1; $i++) {
                $images[] = [
                    "noRetina" => [
                        "thumb" => BsHelper::imageUrl($productImages[0]["image"], 50, 50),
                    ],
                    "retina" => [
                        "thumb" => BsHelper::imageUrl($productImages[0]["image"], 100, 100),
                    ],
                ];
            }

    volodyahome, 26 Февраля 2025

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

    0

    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
    <!-- < ?php
    $isAdmin = User::checkAdmin();
    if($isAdmin) {
    ?>
    <section class="promoCertificate">
    <div class="promoCertificate__wrapper">
    <img class="promoCertificate__logo" src="/images/header/promoCertificate-logo-big.png">
    <div class="promoCertificate__title">
    <p class="promoCertificate__title_big">Это знак</p>
    <p class="promoCertificate__title_small">ЗН АК КАЧЕСТВА</p>
    </div>
    <img class="promoCertificate__nagiev" src="/images/header/promoCertificate-nagiev.png">
    <div class="promoCertificate__description">Ва м доступен <span class="promoCertificate__description_whi te">личный сертификат</span> на покупку массажного кресла номиналом <span class="promoCertificate__description_whi te promoCertificate__description_big ">30 000 ₽</span></div>
    <a href="/personal-certificate" class="promoCertificate__button-details">Подробнее</a>
    <button type="button" class="promoCertificate__button-close promoCertificate__button-close_mobile __js-closeCertificatePromo">не интересно</button>
    </div>
    <button type="button" class="promoCertificate__button-close __js-closeCertificatePromo"></button>
    </section>
    < ?php }; ?> -->
    <!-- модалка с количеством подарков и ссылкой на страницу подарков -->
    <!-- удалять prize__hide -->

    На сайте одного крупного производителя массажных кресел, прямо в исходном коде страницы отображается внебрачный ребенок Laravel и Bitrix -- чудесная смесь html и php прямо в одном файле и проверка прав пользователя прямо в исходном коде страницы.

    McLotos, 30 Января 2025

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

    0

    1. 1
    На сайте одного крупного производителя массажных кресел, прямо в исходном коде страницы отображается внебрачный ребенок Laravel и Bitrix -- чудесная смесь html и php прямо в одном файле и проверка прав пользователя прямо в исходном коде страницы.

    <!-- < ?php
    $isAdmin = User::checkAdmin();
    if($isAdmin) {
    ?>
    <section class="promoCertificate">
    <div class="promoCertificate__wrapper">
    <img class="promoCertificate__logo" src="/images/header/promoCertificate-logo-big.png">
    <div class="promoCertificate__title">
    <p class="promoCertificate__title_big">Это знак</p>
    <p class="promoCertificate__title_small">ЗН АК КАЧЕСТВА</p>
    </div>
    <img class="promoCertificate__nagiev" src="/images/header/promoCertificate-nagiev.png">
    <div class="promoCertificate__description">Ва м доступен <span class="promoCertificate__description_whi te">личный сертификат</span> на покупку массажного кресла номиналом <span class="promoCertificate__description_whi te promoCertificate__description_big ">30 000 ₽</span></div>
    <a href="/personal-certificate" class="promoCertificate__button-details">Подробнее</a>
    <button type="button" class="promoCertificate__button-close promoCertificate__button-close_mobile __js-closeCertificatePromo">не интересно</button>
    </div>
    <button type="button" class="promoCertificate__button-close __js-closeCertificatePromo"></button>
    </section>
    < ?php }; ?> -->
    <!-- модалка с количеством подарков и ссылкой на страницу подарков -->
    <!-- удалять prize__hide -->

    McLotos, 30 Января 2025

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

    0

    1. 1
    $_GET

    OCETuHCKuu_nemyx, 15 Октября 2024

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

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    // Load the core Kohana class
    require SYSPATH . 'classes/Kohana/Core' . EXT;
    
    if (is_file(APPPATH . 'classes/Kohana' . EXT)) {
        // Application extends the core
        require APPPATH . 'classes/Kohana' . EXT;
    } else {
        // Load empty core extension
        require SYSPATH . 'classes/Kohana' . EXT;
    }

    нужно как можно больше констант

    1111nomi, 09 Сентября 2024

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