From dff94f6369daefe7561d367fef8a9c75871da771 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 10 Oct 2007 08:29:43 +0100 Subject: [PATCH] add new option: ENABLE_TAGWALL --- config.php-dist | 9 ++++++++- functions.php | 23 ++++++++++++++++------- sanity_check.php | 2 +- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/config.php-dist b/config.php-dist index 9060ccaaf..b93143711 100644 --- a/config.php-dist +++ b/config.php-dist @@ -163,7 +163,14 @@ // These two options enable SMTP authentication when sending // digests. Require DIGEST_SMTP_HOST. - define('CONFIG_VERSION', 9); + define('ENABLE_TAGWALL', true); + // Disable this if you are having troubles with Tagwall library which + // is used to strip potentially unsafe content from RSS articles. When + // disabled, simpler version of processing will be used when needed. + // Try disabling when having problems with showing articles and/or + // loading feeds. + + define('CONFIG_VERSION', 10); // Expected config version. Please update this option in config.php // if necessary (after migrating all new options from this file). diff --git a/functions.php b/functions.php index ea991269d..f87491d61 100644 --- a/functions.php +++ b/functions.php @@ -73,11 +73,13 @@ require_once 'magpierss/rss_utils.inc'; } - include_once "tw/tw-config.php"; - include_once "tw/tw.php"; - include_once TW_SETUP . "paranoya.php"; + if (ENABLE_TAGWALL) { + include_once "tw/tw-config.php"; + include_once "tw/tw.php"; + include_once TW_SETUP . "paranoya.php"; - $tw_parser = new twParser(); + $tw_parser = new twParser(); + } function _debug($msg) { $ts = strftime("%H:%M:%S", time()); @@ -3169,10 +3171,17 @@ $res = $str; if (get_pref($link, "STRIP_UNSAFE_TAGS") || $force_strip_tags) { - global $tw_parser; - global $tw_paranoya_setup; - $res = $tw_parser->strip_tags($res, $tw_paranoya_setup); + if (ENABLE_TAGWALL) { + global $tw_parser; + global $tw_paranoya_setup; + + $res = $tw_parser->strip_tags($res, $tw_paranoya_setup); + } else { + + $res = strip_tags_long($res, "