some issues with mod_display on very first anonymous page visit (prior to any browser cookies being set)

This commit is contained in:
zotlabs
2017-08-30 18:55:56 -07:00
parent be097bf415
commit f436ec6f21
5 changed files with 15 additions and 13 deletions

View File

@@ -21,9 +21,9 @@ class CheckJS {
$page = urlencode(\App::$query_string);
if($test) {
self::$jsdisabled = 1;
$this->jsdisabled = 1;
if(array_key_exists('jsdisabled',$_COOKIE))
self::$jsdisabled = $_COOKIE['jsdisabled'];
$this->jsdisabled = $_COOKIE['jsdisabled'];
if(! array_key_exists('jsdisabled',$_COOKIE)) {
\App::$page['htmlhead'] .= "\r\n" . '<script>document.cookie="jsdisabled=0; path=/"; var jsMatch = /\&jsdisabled=0/; if (!jsMatch.exec(location.href)) { location.href = "' . z_root() . '/nojs/0?f=&redir=' . $page . '" ; }</script>' . "\r\n";
@@ -41,7 +41,7 @@ class CheckJS {
}
function disabled() {
return self::$jsdisabled;
return $this->jsdisabled;
}