1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +02:00

[ticket/11647] Always use & for URLs

Remove code for URLs separated with ;
Add test case for mix of & and & in URLs

PHPBB3-11647
This commit is contained in:
Vjacheslav Trushkin
2013-07-11 18:13:48 -04:00
parent 94fc0cccdc
commit f5c2119e7c
3 changed files with 9 additions and 16 deletions

View File

@@ -40,7 +40,7 @@ class phpbb_template_asset
{
// Workaround for PHP 5.4.6 and older bug #62844 - add fake scheme and then remove it
$this->components = parse_url('http:' . $url);
unset($this->components['scheme']);
$this->components['scheme'] = '';
return;
}
$this->components = parse_url($url);
@@ -176,8 +176,7 @@ class phpbb_template_asset
$query = $this->components['query'];
if (!preg_match('/(^|[&;])assets_version=/', $query))
{
$separator = (strpos($query, '&') === false) && (strpos($query, ';') !== false) && preg_match('/^.*=.*;.*=.*$/', $query) ? ';' : '&';
$this->components['query'] = $query . $separator . 'assets_version=' . $version;
$this->components['query'] = $query . '&assets_version=' . $version;
}
}
}