- 1
- 2
- 3
- 4
- 5
- 6
public function getResource(): ResourceInterface
{
$locale = $this->localeRepository->getByKey($this->getCurrentLocaleKey());
return new Resource($locale->getKey());
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
0
public function getResource(): ResourceInterface
{
$locale = $this->localeRepository->getByKey($this->getCurrentLocaleKey());
return new Resource($locale->getKey());
}
+1
<? // get current season for header styling
$current_month = date("m");
if($current_month >= "03" && $current_month <= "05") $season = "spring";
elseif($current_month >= "06" && $current_month <= "08") $season = "spring";
elseif($current_month >= "09" && $current_month <= "11") $season = "autumn";
else $season = "winter";
?>
И про теги в стиле говноБитрикса не забыли
0
<!-- <div class="news">
<div class="tch"></div>
<div class="container">
<h2 class="title"><span><small>Н</small>овости компании</span></h2>
<div class="flex">
<?php
query_posts('cat=21&posts_per_page=3'); // вместо "5" указываем идентификатор вашей рубрики.
while (have_posts()) : the_post();
?>
<div class="item">
<div class="img"><?= get_the_post_thumbnail(get_the_ID()); ?></div>
<div class="desk">
<div class="title"><?= get_the_title() ?></div>
<div class="date"><?= get_the_date(); ?></div>
<?php the_content() ?>
<a href="<?= get_the_permalink(); ?>" class="more">Читать далее</a>
</div>
</div>
<?php
endwhile;
wp_reset_query();
?>
</div>
</div>
</div> -->
На ровном месте быдлокодер получает мимимум 7 лишних запросов к БД.
0
<?php
/**********************
R.I.P PHP 6.6.6
Dedicaded to Victoria Null& from Vladivostok vodka drinkers
***********************/
_: 004 | 001 & !!!define("_", [null, !32768, (float)'\x1551', (bool)'\x9', 2, 3, 4, 5, 6, 10, 15, 16, 24, 31,
42, 47, -1024, 56, 58, 60, 61, 62, PHP_INT_MIN, 63, 64, 65, (null), 72, 73, 75, 77,
80, 81, 87, 88, 92, 0b10000000000, 100, 101, 111, 127, 128, 129, PHP_INT_MIN - 1, 131,
2048, PHP_INT_MAX - 1, 2049, 1023, 1024, 4095, 4096, 8191, 8192, 9009, 8193,
PHP_INT_MAX, 0b1100, 10001,]) & null | 007 | 006; goto ___;
__: goto _;
___ :
$_ = count(_,);
while (000000000000001 >> 1 ^ $_ ^ 00000000000001 << 0 >> 1)
{
if (!
!!
!!!
!!!!
!!!!! (_[--$_] & (_[$_ & ~0] - 00000000000000000000000000000000000001)))
~ ~~ ~~~ ~~~~ ~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~ ~~~~~~~~~~~~~~ ~~~~~~ ~~~~~ ~~~ ~~ ~
print __NAMESPACE__ . __FUNCTION__ . __METHOD__ . \_[$_ | 000] . null . PHP_EOL;
~ ~~ ~~~ ~~~~ ~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~ ~~~~~~~~~~~~~~ ~~~~~~ ~~~~~ ~~~ ~~ 0;
}
###### Since [full of ol' su*kers] board decided to fire my possibly edgy person off the team now you're looking at this brainf**kin shit.
###### Better go invest into D-- or B++ you stupid monks ######
###### /* C/T/F m/a/r/k/e/r: the snippet above works only on 7.3.0+
###### Allowed to change ONLY 1 character to make it compiles on lower versions.
###### Anwser format: #.#.# (Min. version number which has no compile time errors)
###### Happy hooking, fuzzing ladies! */
echo (null[die]) ?>
когда казалось, что хоть пыху немного понимать начал..
Как это распарсить, деды?
0
(Переслано со школьного чата)
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)
+2
<?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";
}
}
}
Программа складывает два целых числа.
+1
<?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»!
+1
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 это проверки на число постов, связанных с куки+айпи.
+1
$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";
}
}
«Форчан» поломали.
0
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),
],
];
}