Skip to content

Commit

Permalink
Need to retain protected method that does this
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Feb 11, 2014
1 parent 89a3321 commit b9e23eb
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions framework/Url/lib/Horde/Url.php
Expand Up @@ -271,6 +271,24 @@ public function toString($raw = false, $full = true)
$url .= '/' . $this->pathInfo;
}

if ($params = $this->_getParameters()) {
$url .= '?' . implode($raw ? '&' : '&', $params);
}

if ($this->anchor) {
$url .= '#' . ($raw ? $this->anchor : rawurlencode($this->anchor));
}

return strval($url);
}

/**
* Return a formatted list of URL parameters.
*
* @return array Parameter list.
*/
protected function _getParameters()
{
if (!isset($this->_cache)) {
$params = array();

Expand All @@ -288,15 +306,7 @@ public function toString($raw = false, $full = true)
$this->_cache = $params;
}

if (!empty($this->_cache)) {
$url .= '?' . implode($raw ? '&' : '&', $this->_cache);
}

if ($this->anchor) {
$url .= '#' . ($raw ? $this->anchor : rawurlencode($this->anchor));
}

return strval($url);
return $this->_cache;
}

/**
Expand Down

0 comments on commit b9e23eb

Please sign in to comment.