mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 05:35:12 +00:00
Merge pull request #273 from zzottel/master
prevent reload loop if JS is active, but no cookies accepted
This commit is contained in:
commit
be6a16139c
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue