aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_posting.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2004-02-15 14:03:19 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2004-02-15 14:03:19 +0000
commitb745d5224f44e447fc5ed06d1804e10b58e7afd2 (patch)
treea8035fb95226c4546fe04e5e2f734b030ae1db04 /phpBB/includes/functions_posting.php
parentd8609ba1c60803912c0b9de9c887290d7f6c5f90 (diff)
downloadforums-b745d5224f44e447fc5ed06d1804e10b58e7afd2.tar
forums-b745d5224f44e447fc5ed06d1804e10b58e7afd2.tar.gz
forums-b745d5224f44e447fc5ed06d1804e10b58e7afd2.tar.bz2
forums-b745d5224f44e447fc5ed06d1804e10b58e7afd2.tar.xz
forums-b745d5224f44e447fc5ed06d1804e10b58e7afd2.zip
removed message type from message parser
assign message if specified parse/decode html if enabled validate url git-svn-id: file:///svn/phpbb/trunk@4834 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_posting.php')
-rw-r--r--phpBB/includes/functions_posting.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 2ac76064fe..9a0aa1bd48 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -533,6 +533,7 @@ function decode_text(&$message, $bbcode_uid)
":o:$bbcode_uid",
":$bbcode_uid"
);
+
$replace = array(
"\n",
'',
@@ -543,6 +544,19 @@ function decode_text(&$message, $bbcode_uid)
$message = ($bbcode_uid) ? str_replace($search, $replace, $message) : str_replace('<br />', "\n", $message);
+ // HTML
+ if ($config['allow_html_tags'])
+ {
+ // If $html is true then "allowed_tags" are converted back from entity
+ // form, others remain
+ $allowed_tags = split(',', $config['allow_html_tags']);
+
+ if (sizeof($allowed_tags))
+ {
+ $message = preg_replace('#\<(\/?)(' . str_replace('*', '.*?', implode('|', $allowed_tags)) . ')\>#is', '&lt;$1$2&gt;', $message);
+ }
+ }
+
$match = array(
'#<!\-\- e \-\-><a href="mailto:(.*?)">.*?</a><!\-\- e \-\->#',
'#<!\-\- m \-\-><a href="(.*?)" target="_blank">.*?</a><!\-\- m \-\->#',
@@ -551,6 +565,7 @@ function decode_text(&$message, $bbcode_uid)
'#<!\-\- s(.*?) \-\-><img src="\{SMILE_PATH\}\/.*? \/><!\-\- s\1 \-\->#',
'#<.*?>#s'
);
+
$replace = array(
'\1',
'\1',
@@ -559,6 +574,7 @@ function decode_text(&$message, $bbcode_uid)
'\1',
''
);
+
$message = preg_replace($match, $replace, $message);
return;