diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2004-01-05 19:19:05 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2004-01-05 19:19:05 +0000 |
commit | c2151b52485c84f87cb5ac10ff5a0aa72ed8cff7 (patch) | |
tree | 7d772150943f69e98cd8e2ceec973bbbdced75e9 /modules/node/node.module | |
parent | daaeef0e8c39ebd28a865526702870b1e7733804 (diff) | |
download | brdo-c2151b52485c84f87cb5ac10ff5a0aa72ed8cff7.tar.gz brdo-c2151b52485c84f87cb5ac10ff5a0aa72ed8cff7.tar.bz2 |
Committed filter separation patch: all filter-related things are now in filter.module (which is a required module).
To do this cleanly, I reorganised some bits of system.module: there is now a generic handler available for simple variable-get/set based configuration pages. Look at filter_admin() or system_view() for example usage.
(based on the patch by Goba)
Diffstat (limited to 'modules/node/node.module')
-rw-r--r-- | modules/node/node.module | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/modules/node/node.module b/modules/node/node.module index df8b0ea73..1164e76dc 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -515,39 +515,6 @@ function node_settings() { return $output; } -function node_conf_filters() { - $group1 .= form_radios(t("Filter HTML tags"), "filter_html", variable_get("filter_html", 0), array(0 => t("Do not filter"), 1 => t("Strip tags"), 2 => t("Escape tags")), t("How to deal with HTML and PHP tags in user-contributed content. If set to \"Strip tags\", dangerous tags are removed (see below). If set to \"Escape tags\", all HTML is escaped and presented as it was typed.")); - $group1 .= form_textfield(t("Allowed HTML tags"), "allowed_html", variable_get("allowed_html", "<a> <b> <dd> <dl> <dt> <i> <li> <ol> <u> <ul>"), 64, 255, t("If \"Strip tags\" is selected, optionally specify tags which should not be stripped. 'ON*' attributes and unclosed tags are always stripped.")); - $group1 .= form_radios(t("HTML style attributes"), "filter_style", variable_get("filter_style", 1), array(t("Allowed"), t("Removed")), t("If \"Strip tags\" is selected, you can choose whether 'STYLE' attributes are allowed or removed from input.")); - $output .= form_group("HTML filtering", $group1); - - $group2 .= form_radios(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 <code>mod_rewrite</code> is available on your system, use the rewrite rules in Drupal's <code>.htaccess</code> file instead as these will also correct external referrers.")); - $output .= form_group("Legacy filtering", $group2); - - return $output; -} - -function node_escape_html($text) { - return htmlspecialchars($text); -} - -function node_filter_html($text) { - $text = strip_tags($text, variable_get("allowed_html", "")); - - if (variable_get("filter_style", 1)) { - $text = preg_replace("/\Wstyle\s*=[^>]+?>/i", ">", $text); - } - - $text = preg_replace("/\Won[a-z]+\s*=[^>]+?>/i", ">", $text); - - return $text; -} - -function node_filter_link($text) { - $pat = '\[{2}([^\|]+)(\|([^\|]+)?)?\]{2}'; // [link|description] - return ereg_replace($pat, $dst, $text); -} - function node_comment_mode($nid) { static $comment_mode; if (!isset($comment_mode[$nid])) { @@ -556,22 +523,6 @@ function node_comment_mode($nid) { return $comment_mode[$nid]; } -function node_filter($text) { - if (variable_get("filter_html", 0) == 1) { - $text = node_filter_html($text); - } - - if (variable_get("rewrite_old_urls", 0)) { - $text = rewrite_old_urls($text); - } - - if (variable_get("filter_html", 0) == 2) { - $text = node_escape_html($text); - } - - return trim($text); -} - function node_link($type, $node = 0, $main = 0) { $links = array(); |