aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/path_helper.php
diff options
context:
space:
mode:
authorCesar G <prototech91@gmail.com>2014-02-07 09:20:49 -0800
committerCesar G <prototech91@gmail.com>2014-04-22 15:21:02 -0700
commit8987fc95f97e2e64915fcbe809a7e14051b8a328 (patch)
treeae808d580842ba9de70e9ce841693fe1441f5b19 /phpBB/phpbb/path_helper.php
parent3163388f63a6d0bac77ada86e2f1561f1d7f9714 (diff)
downloadforums-8987fc95f97e2e64915fcbe809a7e14051b8a328.tar
forums-8987fc95f97e2e64915fcbe809a7e14051b8a328.tar.gz
forums-8987fc95f97e2e64915fcbe809a7e14051b8a328.tar.bz2
forums-8987fc95f97e2e64915fcbe809a7e14051b8a328.tar.xz
forums-8987fc95f97e2e64915fcbe809a7e14051b8a328.zip
[ticket/11508] Change separator parameter to a simple true|false $is_amp.
PHPBB3-11508
Diffstat (limited to 'phpBB/phpbb/path_helper.php')
-rw-r--r--phpBB/phpbb/path_helper.php17
1 files changed, 9 insertions, 8 deletions
diff --git a/phpBB/phpbb/path_helper.php b/phpBB/phpbb/path_helper.php
index ff36ce5fc5..b4e7836640 100644
--- a/phpBB/phpbb/path_helper.php
+++ b/phpBB/phpbb/path_helper.php
@@ -238,11 +238,12 @@ class path_helper
* Get the base and parameters of a URL
*
* @param string $url URL to break apart
- * @param string $separator Parameter separator. Defaults to &amp;
+ * @param bool $is_amp Is the parameter separator &amp;. Defaults to true.
* @return array Returns the base and parameters in the form of array('base' => string, 'params' => array(name => value))
*/
- public function get_url_parts($url, $separator = '&amp;')
+ public function get_url_parts($url, $is_amp = true)
{
+ $separator = ($is_amp) ? '&amp;' : '&';
$params = array();
if (strpos($url, '?') !== false)
@@ -281,12 +282,12 @@ class path_helper
*
* @param string $url URL to strip parameters from
* @param array|string $strip Parameters to strip.
- * @param string $separator Parameter separator. Defaults to &amp;
+ * @param bool $is_amp Is the parameter separator &amp;. Defaults to true.
* @return string Returns the new URL.
*/
- public function strip_url_params($url, $strip, $separator = '&amp;')
+ public function strip_url_params($url, $strip, $is_amp = true)
{
- $url_parts = $this->get_url_parts($url, $separator);
+ $url_parts = $this->get_url_parts($url, $is_amp);
$params = $url_parts['params'];
if (!is_array($strip))
@@ -314,12 +315,12 @@ class path_helper
*
* @param string $url URL to append parameters to
* @param array $new_params Parameters to add in the form of array(name => value)
- * @param string $separator Parameter separator. Defaults to &amp;
+ * @param string $is_amp Is the parameter separator &amp;. Defaults to true.
* @return string Returns the new URL.
*/
- public function append_url_params($url, $new_params, $separator = '&amp;')
+ public function append_url_params($url, $new_params, $is_amp = true)
{
- $url_parts = $this->get_url_parts($url, $separator);
+ $url_parts = $this->get_url_parts($url, $is_amp);
$params = array_merge($url_parts['params'], $new_params);
// Move the sid to the end if it's set