From f8c1d7c80fd072fba64513815c76ab16e73bf3f2 Mon Sep 17 00:00:00 2001 From: 8chan Date: Mon, 15 Dec 2014 17:50:22 -0800 Subject: [PATCH 1/2] 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 --- inc/functions.php | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) 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); } From cccc1bff79723951f0a9f89326d26f399ee4c487 Mon Sep 17 00:00:00 2001 From: 8chan Date: Mon, 15 Dec 2014 17:52:31 -0800 Subject: [PATCH 2/2] Fix new highlightReply in Gecko --- templates/main.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/main.js b/templates/main.js index 23af9447..74cf40e6 100644 --- a/templates/main.js +++ b/templates/main.js @@ -1,5 +1,4 @@ {% raw %} - /* gettext-compatible _ function, example of usage: * * > // Loading pl_PL.json here (containing polish translation strings generated by tools/i18n_compile.php) @@ -258,7 +257,7 @@ function highlightReply(id) { if (typeof window.event != "undefined") { // don't highlight on middle click if (event.which == 2) return true; - window.event.preventDefault(); + if (active_page == 'thread' && typeof window.event.preventDefault != "undefined") window.event.preventDefault(); } var divs = document.getElementsByTagName('div'); @@ -434,6 +433,9 @@ function ready() { var post_date = "{{ config.post_date }}"; var max_images = {{ config.max_images }}; +if (typeof active_page === "undefined") { + active_page = "page"; +} {% if config.google_analytics %}{% raw %}