what the fuck were you even thinking

this is an insane default

BUGFIX: all-Japanese, all-Arabic, etc posts no longer trip the filter if not robot_enable
This commit is contained in:
8chan 2014-12-15 17:50:22 -08:00
parent 968fab9420
commit f8c1d7c80f

View File

@ -1332,23 +1332,26 @@ function getPages($mod=false) {
// Stolen with permission from PlainIB (by Frank Usrs)
function make_comment_hex($str) {
global $config;
// remove cross-board citations
// the numbers don't matter
$str = preg_replace('!>>>/[A-Za-z0-9]+/!', '', $str);
$str = preg_replace("!>>>/[A-Za-z0-9]+/!", '', $str);
if (function_exists('iconv')) {
// remove diacritics and other noise
// FIXME: this removes cyrillic entirely
$oldstr = $str;
$str = @iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $str);
if (!$str) $str = $oldstr;
if ($config['robot_enable']) {
if (function_exists('iconv')) {
// remove diacritics and other noise
// FIXME: this removes cyrillic entirely
$oldstr = $str;
$str = @iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $str);
if (!$str) $str = $oldstr;
}
$str = strtolower($str);
// strip all non-alphabet characters
$str = preg_replace('/[^a-z]/', '', $str);
}
$str = strtolower($str);
// strip all non-alphabet characters
$str = preg_replace('/[^a-z]/', '', $str);
return md5($str);
}