aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-01-16 13:06:49 -0800
committerfriendica <info@friendica.com>2014-01-16 13:06:49 -0800
commitbe6a16139c422b95f26080f4d0effecc0ed19515 (patch)
tree51407a94465c404c2e3978fca84baf8b038f1caf
parent5c606a19cf59b548fd44eb95e417c6a03b565494 (diff)
parent1280a9abfa94156aad2dc8953ced30effb9bf875 (diff)
downloadvolse-hubzilla-be6a16139c422b95f26080f4d0effecc0ed19515.tar.gz
volse-hubzilla-be6a16139c422b95f26080f4d0effecc0ed19515.tar.bz2
volse-hubzilla-be6a16139c422b95f26080f4d0effecc0ed19515.zip
Merge pull request #273 from zzottel/master
prevent reload loop if JS is active, but no cookies accepted
-rwxr-xr-xindex.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/index.php b/index.php
index 640a2b6a1..6ffef19cb 100755
--- a/index.php
+++ b/index.php
@@ -245,7 +245,11 @@ if(! x($a->page,'content'))
/* set JS cookie */
if($_COOKIE['jsAvailable'] != 1) {
- $a->page['content'] .= '<script>document.cookie="jsAvailable=1; path=/"; location.reload();</script>';
+ $a->page['content'] .= '<script>document.cookie="jsAvailable=1; path=/"; var jsMatch = /\&JS=1/; if (!jsMatch.exec(location.href)) { location.href = location.href + "&JS=1"; }</script>';
+ /* emulate JS cookie if cookies are not accepted */
+ if ($_GET['JS'] == 1) {
+ $_COOKIE['jsAvailable'] = 1;
+ }
}