diff options
author | Dries Buytaert <dries@buytaert.net> | 2002-09-26 16:12:09 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2002-09-26 16:12:09 +0000 |
commit | 56bd15ef4f14dec4cf67be84abc18ea562e7a83c (patch) | |
tree | 6b6799950c74a7c3f9911ef8def99fd8e9481e08 /modules/node/node.module | |
parent | 2c165d0e2f23c0f14adca0368de41e50842a6542 (diff) | |
download | brdo-56bd15ef4f14dec4cf67be84abc18ea562e7a83c.tar.gz brdo-56bd15ef4f14dec4cf67be84abc18ea562e7a83c.tar.bz2 |
- Applied Marco's first regex patch.
Diffstat (limited to 'modules/node/node.module')
-rw-r--r-- | modules/node/node.module | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/node/node.module b/modules/node/node.module index e9bdb3d17..9aaf8a0e3 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -300,8 +300,6 @@ function node_conf_filters() { } function node_filter_html($text) { - $text = eregi_replace("([ \f\r\t\n\'\"])style=[^>]+>", "\\1", $text); - $text = eregi_replace("([ \f\r\t\n\'\"])on[a-z]+=[^>]+>", "\\1", $text); $text = strip_tags($text, variable_get("allowed_html", "")); return $text; } @@ -370,6 +368,11 @@ function node_comment_mode($nid) { } function node_filter($text) { + $text = preg_replace("/\Wstyle\s*=[^>]+?>/i", ">", $text); + $text = preg_replace("/\Won[a-z]+\s*=[^>]+?>/i", ">", $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); return node_filter_line($text); |