Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'core/UrlHelper.php')
-rw-r--r--core/UrlHelper.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/UrlHelper.php b/core/UrlHelper.php
index cf2eb468c8..20501515f2 100644
--- a/core/UrlHelper.php
+++ b/core/UrlHelper.php
@@ -155,6 +155,14 @@ class UrlHelper
if (strlen($urlQuery) == 0) {
return array();
}
+
+ $cache = Cache::getTransientCache();
+ $cacheKey = 'arrayFromQuery' . $urlQuery;
+
+ if ($cache->contains($cacheKey)) {
+ return $cache->fetch($cacheKey);
+ }
+
if ($urlQuery[0] == '?') {
$urlQuery = substr($urlQuery, 1);
}
@@ -200,6 +208,9 @@ class UrlHelper
$nameToValue[$name] = $value;
}
}
+
+ $cache->save($cacheKey, $nameToValue);
+
return $nameToValue;
}
@@ -214,6 +225,7 @@ class UrlHelper
public static function getParameterFromQueryString($urlQuery, $parameter)
{
$nameToValue = self::getArrayFromQueryString($urlQuery);
+
if (isset($nameToValue[$parameter])) {
return $nameToValue[$parameter];
}