aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/path_helper.php
diff options
context:
space:
mode:
authorJakub Senko <jakubsenko@gmail.com>2014-09-04 13:33:04 +0200
committerJakub Senko <jakubsenko@gmail.com>2014-09-04 13:33:04 +0200
commit17e4e5f8c4995f5818411382ccf4b799ddbe0b11 (patch)
treede6d7483d4f1fe3baf0bde9f108c21415e546111 /phpBB/phpbb/path_helper.php
parent10c99b3c2b92206840e6c3048fea4bd273f53472 (diff)
downloadforums-17e4e5f8c4995f5818411382ccf4b799ddbe0b11.tar
forums-17e4e5f8c4995f5818411382ccf4b799ddbe0b11.tar.gz
forums-17e4e5f8c4995f5818411382ccf4b799ddbe0b11.tar.bz2
forums-17e4e5f8c4995f5818411382ccf4b799ddbe0b11.tar.xz
forums-17e4e5f8c4995f5818411382ccf4b799ddbe0b11.zip
[ticket/12852] Make get_url_parts handle get variable with no value
PHPBB3-12852
Diffstat (limited to 'phpBB/phpbb/path_helper.php')
-rw-r--r--phpBB/phpbb/path_helper.php24
1 files changed, 21 insertions, 3 deletions
diff --git a/phpBB/phpbb/path_helper.php b/phpBB/phpbb/path_helper.php
index 38dbbab51e..b2758f8654 100644
--- a/phpBB/phpbb/path_helper.php
+++ b/phpBB/phpbb/path_helper.php
@@ -316,7 +316,7 @@ class path_helper
* Glue URL parameters together
*
* @param array $params URL parameters in the form of array(name => value)
- * @return string Returns the glued string, e.g. name1=value1&amp;name2=value2
+ * @return string Returns the glued string, e.g. name1=value1&amp;name2&amp;name3=value3
*/
public function glue_url_params($params)
{
@@ -324,7 +324,15 @@ class path_helper
foreach ($params as $key => $value)
{
- $_params[] = $key . '=' . $value;
+ // some parameters do not have value
+ if($value !== null)
+ {
+ $_params[] = $key . '=' . $value;
+ }
+ else
+ {
+ $_params[] = $key;
+ }
}
return implode('&amp;', $_params);
}
@@ -353,7 +361,17 @@ class path_helper
{
continue;
}
- list($key, $value) = explode('=', $argument, 2);
+
+ // some parameters don't have value
+ if (strpos($argument, '=') !== false)
+ {
+ list($key, $value) = explode('=', $argument, 2);
+ }
+ else
+ {
+ $key = $argument;
+ $value = null;
+ }
if ($key === '')
{