diff --git a/inc/functions.php b/inc/functions.php index dd02ce79..e72708fd 100755 --- a/inc/functions.php +++ b/inc/functions.php @@ -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); }