From 8987fc95f97e2e64915fcbe809a7e14051b8a328 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Fri, 7 Feb 2014 09:20:49 -0800 Subject: [ticket/11508] Change separator parameter to a simple true|false $is_amp. PHPBB3-11508 --- phpBB/phpbb/path_helper.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'phpBB/phpbb/path_helper.php') 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 & + * @param bool $is_amp Is the parameter separator &. 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 = '&') + public function get_url_parts($url, $is_amp = true) { + $separator = ($is_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 & + * @param bool $is_amp Is the parameter separator &. Defaults to true. * @return string Returns the new URL. */ - public function strip_url_params($url, $strip, $separator = '&') + 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 & + * @param string $is_amp Is the parameter separator &. Defaults to true. * @return string Returns the new URL. */ - public function append_url_params($url, $new_params, $separator = '&') + 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 -- cgit v1.2.1