diff options
author | Gabriel Vazquez <leviatan21@phpbb.com> | 2009-06-21 16:00:42 +0000 |
---|---|---|
committer | Gabriel Vazquez <leviatan21@phpbb.com> | 2009-06-21 16:00:42 +0000 |
commit | eb72e526b804844839555314914049eec75f1398 (patch) | |
tree | addcf7af21c7d297e4c621852935cff206540b2f /phpBB/includes/functions.php | |
parent | b16626e947328379ea986c10fe1c4840e502aacb (diff) | |
download | forums-eb72e526b804844839555314914049eec75f1398.tar forums-eb72e526b804844839555314914049eec75f1398.tar.gz forums-eb72e526b804844839555314914049eec75f1398.tar.bz2 forums-eb72e526b804844839555314914049eec75f1398.tar.xz forums-eb72e526b804844839555314914049eec75f1398.zip |
Fixed bug #43125
Authorised by: AcydBurn
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9648 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r-- | phpBB/includes/functions.php | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index dd82f9e53d..14e1dde92f 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2261,17 +2261,12 @@ function reapply_sid($url) } // Remove previously added sid - if (strpos($url, '?sid=') !== false) + if (strpos($url, 'sid=') !== false) { - $url = preg_replace('/(\?)sid=[a-z0-9]+(&|&)?/', '\1', $url); - } - else if (strpos($url, '&sid=') !== false) - { - $url = preg_replace('/&sid=[a-z0-9]+(&)?/', '\1', $url); - } - else if (strpos($url, '&sid=') !== false) - { - $url = preg_replace('/&sid=[a-z0-9]+(&)?/', '\1', $url); + // All kind of links + $url = preg_replace('/(\?)?(&|&)?sid=[a-z0-9]+/', '', $url); + // if the sid was the first param, make the old second as first ones + $url = preg_replace("/$phpEx(&|&)+?/", "$phpEx?", $url); } return append_sid($url); |