diff options
author | Christian Schneider | 2014-09-01 18:08:37 +0200 |
---|---|---|
committer | Christian Schneider | 2014-09-01 18:08:37 +0200 |
commit | 901603122feb5ecb73156eae297129a0f18f8d71 (patch) | |
tree | dcfa8688e5b1b34e7285c6365ef3c1fccbdc5671 | |
parent | 229721a6235f62a0d04a583cbf09bcbb0e216647 (diff) | |
download | itools-901603122feb5ecb73156eae297129a0f18f8d71.tar.gz itools-901603122feb5ecb73156eae297129a0f18f8d71.tar.bz2 itools-901603122feb5ecb73156eae297129a0f18f8d71.zip |
Simplify it_url::parse
-rw-r--r-- | it_url.class | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/it_url.class b/it_url.class index e657fd3..3b8f5b0 100644 --- a/it_url.class +++ b/it_url.class @@ -825,15 +825,12 @@ static function _params($params, $keys = null) /** * Convert url into array with base url in $result[0] and GET params - * @param $paramsonly Only return GET params */ -static function parse($url, $paramsonly = false) +static function parse($url) { - list($path, $query) = explode("?", $url); - if ($query) - parse_str($query, $params); - - return ($paramsonly ? array() : array($path)) + (array)$params; + list($path, $query) = explode("?", $url, 2); + parse_str((string)$query, $params); + return (array)$path + (array)$params; } } |