From 9863dd5a71193a5d8078b582b025a9e5ed4757c2 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 23 May 2003 21:59:44 +0000 Subject: - Fixed typo in URL(). Patch by Al. - Added a filter option to disable/enable the rewrite_old_urls() filter. See task #1542. --- modules/node.module | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'modules/node.module') diff --git a/modules/node.module b/modules/node.module index b8471124c..1b9202e68 100644 --- a/modules/node.module +++ b/modules/node.module @@ -456,9 +456,8 @@ function node_settings() { function node_conf_filters() { $output .= form_select(t("Filter HTML tags"), "filter_html", variable_get("filter_html", 0), array(t("Disabled"), t("Enabled")), t("Filter HTML and PHP tags in user-contributed content.")); $output .= form_textfield(t("Allowed HTML tags"), "allowed_html", variable_get("allowed_html", "
      • "), 64, 255, t("If enabled, optionally specify tags which should not be stripped. 'STYLE' attributes, 'ON' attributes and unclosed tags are always stripped.")); + $output .= form_select(t("Rewrite old URLs"), "rewrite_old_urls", variable_get("rewrite_old_urls", 0), array(t("Disabled"), t("Enabled")), t("The introduction of 'clean URLs' in Drupal 4.2.0 breaks internal URLs that date back from Drupal 4.1.0 and before. If enabled, this filter will attempt to rewrite the old style URLs to avoid broken links. If mod_rewrite is available on your system, use the rewrite rules in Drupal's .htaccess file instead as these will also correct external referrers.")); $output .= "
        "; - // $output .= form_select(t("Enable link tags"), "filter_link", variable_get("filter_link", 0), array(t("Disabled"), t("Enabled")), t("Substitute special [[nodesubject|text]] tags. Your browser will display 'text', and when you click on it your browser will open the node with the subject 'nodesubject'. Please be aware that you'll need to copy the subject of the target node exactly in order to use this feature.")); - // $output .= "
        "; return $output; } @@ -469,7 +468,6 @@ function node_filter_html($text) { function node_filter_link($text) { $pat = '\[{2}([^\|]+)(\|([^\|]+)?)?\]{2}'; // [link|description] -// $dst = str_replace('%5C1', '\\1', format_tag('\\1', '\\3')); // [link|description] return ereg_replace($pat, $dst, $text); } @@ -487,8 +485,13 @@ function node_filter($text) { $text = preg_replace("/\Wsrc\s*=[\s'\"]*javascript[^>]+?>/i", ">", $text); $text = preg_replace("/\Whref\s*=[\s'\"]*javascript:[^>]+?>/i", ">", $text); - if (variable_get("filter_html", 0)) $text = node_filter_html($text); - // if (variable_get("filter_link", 0)) $text = node_filter_link($text); + if (variable_get("filter_html", 0)) { + $text = node_filter_html($text); + } + + if (variable_get("rewrite_old_urls", 0)) { + $text = rewrite_old_urls($text); + } return trim($text); } -- cgit v1.2.3