mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
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:
parent
f2bdbcfecd
commit
6875bd59b4
1 changed files with 12 additions and 5 deletions
|
@ -799,16 +799,23 @@ class bbcode_firstpass extends bbcode
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Checking urls
|
// Before we check anything, we make sure certain characters are not included
|
||||||
if (preg_match('#' . preg_quote(generate_board_url(), '#') . '/([^ \t\n\r<"\']+)#i', $url) ||
|
if (!preg_match('#[\t\n\r<"\']#', $url))
|
||||||
preg_match('#([\w]+?://.*?[^ \t\n\r<"\']*)#i', $url) ||
|
|
||||||
preg_match('#(www\.[\w\-]+\.[\w\-.\~]+(?:/[^ \t\n\r<"\']*)?)#i', $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)
|
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))
|
||||||
|
|
Loading…
Add table
Reference in a new issue