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
This commit is contained in:
Meik Sievertsen 2006-12-12 09:55:15 +00:00
parent f2bdbcfecd
commit 6875bd59b4

View file

@ -799,6 +799,9 @@ class bbcode_firstpass extends bbcode
return ''; return '';
} }
// Before we check anything, we make sure certain characters are not included
if (!preg_match('#[\t\n\r<"\']#', $url))
{
// Checking urls // Checking urls
if (preg_match('#' . preg_quote(generate_board_url(), '#') . '/([^ \t\n\r<"\']+)#i', $url) || if (preg_match('#' . preg_quote(generate_board_url(), '#') . '/([^ \t\n\r<"\']+)#i', $url) ||
preg_match('#([\w]+?://.*?[^ \t\n\r<"\']*)#i', $url) || preg_match('#([\w]+?://.*?[^ \t\n\r<"\']*)#i', $url) ||
@ -806,9 +809,13 @@ class bbcode_firstpass extends bbcode
{ {
$valid = true; $valid = true;
} }
}
if ($valid) if ($valid)
{ {
// Do we want to transform some characters?
$url = str_replace(' ', '%20', $url);
$this->parsed_items['url']++; $this->parsed_items['url']++;
if (!preg_match('#^[\w]+?://.*?#i', $url)) if (!preg_match('#^[\w]+?://.*?#i', $url))