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:
authordiosmosis <benakamoorthi@fastmail.fm>2014-06-18 04:45:48 +0400
committerdiosmosis <benakamoorthi@fastmail.fm>2014-06-18 04:46:05 +0400
commit571a245ae7511349328567b3fef6c71211ef6a44 (patch)
tree55bf629e249e83b38c95e8ad4b5122c9ae60a0c9 /core/Http.php
parent02ffeeb228f88d6053edf777d094b34c47b086b4 (diff)
Refactoring ProxyHttp for clarity & code cleanliness.
Diffstat (limited to 'core/Http.php')
-rw-r--r--core/Http.php22
1 files changed, 21 insertions, 1 deletions
diff --git a/core/Http.php b/core/Http.php
index 996c3885a9..7eb9ea94f9 100644
--- a/core/Http.php
+++ b/core/Http.php
@@ -752,4 +752,24 @@ class Http
}
return $str;
}
-}
+
+ /**
+ * Returns the If-Modified-Since HTTP header if it can be found. If it cannot be
+ * found, an empty string is returned.
+ *
+ * @return string
+ */
+ public static function getModifiedSinceHeader()
+ {
+ $modifiedSince = '';
+ if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
+ $modifiedSince = $_SERVER['HTTP_IF_MODIFIED_SINCE'];
+
+ // strip any trailing data appended to header
+ if (false !== ($semicolonPos = strpos($modifiedSince, ';'))) {
+ $modifiedSince = substr($modifiedSince, 0, $semicolonPos);
+ }
+ }
+ return $modifiedSince;
+ }
+} \ No newline at end of file