forked from GithubBackups/vichan
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:
parent
968fab9420
commit
f8c1d7c80f
@ -1332,23 +1332,26 @@ function getPages($mod=false) {
|
|||||||
|
|
||||||
// Stolen with permission from PlainIB (by Frank Usrs)
|
// Stolen with permission from PlainIB (by Frank Usrs)
|
||||||
function make_comment_hex($str) {
|
function make_comment_hex($str) {
|
||||||
|
global $config;
|
||||||
// remove cross-board citations
|
// remove cross-board citations
|
||||||
// the numbers don't matter
|
// 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')) {
|
if ($config['robot_enable']) {
|
||||||
// remove diacritics and other noise
|
if (function_exists('iconv')) {
|
||||||
// FIXME: this removes cyrillic entirely
|
// remove diacritics and other noise
|
||||||
$oldstr = $str;
|
// FIXME: this removes cyrillic entirely
|
||||||
$str = @iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $str);
|
$oldstr = $str;
|
||||||
if (!$str) $str = $oldstr;
|
$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);
|
return md5($str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user