aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/message_parser.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-12-12 09:55:15 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-12-12 09:55:15 +0000
commit6875bd59b4eb4bedd9b62855d2d9f571169690a4 (patch)
treee14747b0ee1f1e409abd049332f678b289bb2aaa /phpBB/includes/message_parser.php
parentf2bdbcfecdc890b54cc32c8d8544d95367607d10 (diff)
downloadforums-6875bd59b4eb4bedd9b62855d2d9f571169690a4.tar
forums-6875bd59b4eb4bedd9b62855d2d9f571169690a4.tar.gz
forums-6875bd59b4eb4bedd9b62855d2d9f571169690a4.tar.bz2
forums-6875bd59b4eb4bedd9b62855d2d9f571169690a4.tar.xz
forums-6875bd59b4eb4bedd9b62855d2d9f571169690a4.zip
until nils comes to inspecting this further we will use this "workaround"
git-svn-id: file:///svn/phpbb/trunk@6750 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/message_parser.php')
-rw-r--r--phpBB/includes/message_parser.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index 561b2d79da..ebac61dd8f 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -799,16 +799,23 @@ class bbcode_firstpass extends bbcode
return '';
}
- // Checking urls
- if (preg_match('#' . preg_quote(generate_board_url(), '#') . '/([^ \t\n\r<"\']+)#i', $url) ||
- preg_match('#([\w]+?://.*?[^ \t\n\r<"\']*)#i', $url) ||
- preg_match('#(www\.[\w\-]+\.[\w\-.\~]+(?:/[^ \t\n\r<"\']*)?)#i', $url))
+ // Before we check anything, we make sure certain characters are not included
+ if (!preg_match('#[\t\n\r<"\']#', $url))
{
- $valid = true;
+ // Checking urls
+ if (preg_match('#' . preg_quote(generate_board_url(), '#') . '/([^ \t\n\r<"\']+)#i', $url) ||
+ preg_match('#([\w]+?://.*?[^ \t\n\r<"\']*)#i', $url) ||
+ preg_match('#(www\.[\w\-]+\.[\w\-.\~]+(?:/[^ \t\n\r<"\']*)?)#i', $url))
+ {
+ $valid = true;
+ }
}
if ($valid)
{
+ // Do we want to transform some characters?
+ $url = str_replace(' ', '%20', $url);
+
$this->parsed_items['url']++;
if (!preg_match('#^[\w]+?://.*?#i', $url))