summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--_test/tests/inc/auth_browseruid.test.php30
-rw-r--r--inc/auth.php1
2 files changed, 30 insertions, 1 deletions
diff --git a/_test/tests/inc/auth_browseruid.test.php b/_test/tests/inc/auth_browseruid.test.php
new file mode 100644
index 000000000..d33552582
--- /dev/null
+++ b/_test/tests/inc/auth_browseruid.test.php
@@ -0,0 +1,30 @@
+<?php
+
+class auth_browseruid_test extends DokuWikiTest {
+
+
+ /**
+ * regression test to ensure correct browser id on IE9.
+ *
+ * IE9 send different HTTP_ACCEPT_LANGUAGE header on ajax request.
+ */
+ function testIE9JsVsDefault() {
+
+ // javascript request
+ $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)';
+ $_SERVER['HTTP_ACCEPT_ENCODING'] = 'gzip, deflate';
+ $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'de';
+ unset($_SERVER['HTTP_ACCEPT_CHARSET']);
+ $javascriptId = auth_browseruid();
+
+ // default request
+ $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)';
+ $_SERVER['HTTP_ACCEPT_ENCODING'] = 'gzip, deflate';
+ $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'de-DE';
+ $normalId = auth_browseruid();
+
+ $this->assertEquals($normalId, $javascriptId);
+
+ }
+
+} \ No newline at end of file
diff --git a/inc/auth.php b/inc/auth.php
index 9566a2615..d82b8b5dd 100644
--- a/inc/auth.php
+++ b/inc/auth.php
@@ -311,7 +311,6 @@ function auth_browseruid() {
$uid = '';
$uid .= $_SERVER['HTTP_USER_AGENT'];
$uid .= $_SERVER['HTTP_ACCEPT_ENCODING'];
- $uid .= $_SERVER['HTTP_ACCEPT_LANGUAGE'];
$uid .= $_SERVER['HTTP_ACCEPT_CHARSET'];
$uid .= substr($ip, 0, strpos($ip, '.'));
$uid = strtolower($uid);