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:
authorThomas Steur <thomas.steur@googlemail.com>2014-12-04 05:04:02 +0300
committerThomas Steur <thomas.steur@googlemail.com>2014-12-04 05:04:02 +0300
commit9d71fc8e92e5b434fd69c7ab4b83a69169064cf3 (patch)
tree8cb2798746e4defb1a978cd758df72006ec419ae /core/Common.php
parent784b738f9c4a92c42a9d8e6b85c28a82a3af0a2f (diff)
Tracker refactoring
Diffstat (limited to 'core/Common.php')
-rw-r--r--core/Common.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/core/Common.php b/core/Common.php
index b5ed581d82..f228053da0 100644
--- a/core/Common.php
+++ b/core/Common.php
@@ -518,7 +518,13 @@ class Common
*/
public static function generateUniqId()
{
- return md5(uniqid(rand(), true));
+ if (function_exists('mt_rand')) {
+ $rand = mt_rand();
+ } else {
+ $rand = rand();
+ }
+
+ return md5(uniqid($rand, true));
}
/**
@@ -1182,10 +1188,12 @@ class Common
}
if (strpos(PHP_SAPI, '-fcgi') === false) {
- $key = $_SERVER['SERVER_PROTOCOL'];
+ $key = 'HTTP/1.1';
- if (strlen($key) > 15 || empty($key)) {
- $key = 'HTTP/1.1';
+ if (array_key_exists('SERVER_PROTOCOL', $_SERVER)
+ && strlen($_SERVER['SERVER_PROTOCOL']) < 15
+ && strlen($_SERVER['SERVER_PROTOCOL']) > 1) {
+ $key = $_SERVER['SERVER_PROTOCOL'];
}
} else {