aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-09-06 15:47:47 +0200
committerTristan Darricau <github@nicofuma.fr>2014-09-06 15:47:47 +0200
commitaf10ca630d93adc41669b1f39288d5c808d322a2 (patch)
treef8fcfb6d9556e8cd8102c38abc58c5f12004d505 /phpBB
parente0711b417fb9e9106af52dcde51ca20dd7b056f2 (diff)
parent297ab5c5260c37bf4db4f220911b4dc8f4ca2674 (diff)
downloadforums-af10ca630d93adc41669b1f39288d5c808d322a2.tar
forums-af10ca630d93adc41669b1f39288d5c808d322a2.tar.gz
forums-af10ca630d93adc41669b1f39288d5c808d322a2.tar.bz2
forums-af10ca630d93adc41669b1f39288d5c808d322a2.tar.xz
forums-af10ca630d93adc41669b1f39288d5c808d322a2.zip
Merge branch 'develop-ascraeus' into develop
* develop-ascraeus: [ticket/12852] Add unit tests [ticket/12852] Add space after if [ticket/12852] Remove whitespace [ticket/12852] Make get_url_parts handle get variable with no value
Diffstat (limited to 'phpBB')
-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..936564d8b6 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 === '')
{