From 6875bd59b4eb4bedd9b62855d2d9f571169690a4 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 12 Dec 2006 09:55:15 +0000 Subject: [PATCH] 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 --- phpBB/includes/message_parser.php | 17 ++++++++++++----- 1 file 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))