/** * Build a query from an array (reverse of the PHP parse_str()). * * @param array $params The array of key => value pairs to return as a query string. * * @return string The resulting query string. * * @see parse_str() * @since 11.1 * @note The parent method is protected, this exposes it as public for B/C */ public static function buildQuery(array $params) { return parent::buildQuery($params); }
/** * Create a uri based on a full or partial url string * * @param string $url The URI * * @return JURI * * @since 11.1 */ protected function _createURI($url) { // Create full URL if we are only appending variables to it if (substr($url, 0, 1) == '&') { $vars = array(); if (strpos($url, '&') !== false) { $url = str_replace('&', '&', $url); } parse_str($url, $vars); $vars = array_merge($this->getVars(), $vars); foreach ($vars as $key => $var) { if ($var == "") { unset($vars[$key]); } } $url = 'index.php?' . Uri::buildQuery($vars); } // Decompose link into url component parts return new Uri($url); }