summaryrefslogtreecommitdiff
path: root/it_url.class
diff options
context:
space:
mode:
authorChristian Schneider2014-09-01 18:08:37 +0200
committerChristian Schneider2014-09-01 18:08:37 +0200
commit901603122feb5ecb73156eae297129a0f18f8d71 (patch)
treedcfa8688e5b1b34e7285c6365ef3c1fccbdc5671 /it_url.class
parent229721a6235f62a0d04a583cbf09bcbb0e216647 (diff)
downloaditools-901603122feb5ecb73156eae297129a0f18f8d71.tar.gz
itools-901603122feb5ecb73156eae297129a0f18f8d71.tar.bz2
itools-901603122feb5ecb73156eae297129a0f18f8d71.zip
Simplify it_url::parse
Diffstat (limited to 'it_url.class')
-rw-r--r--it_url.class11
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;
}
}