reverse the logic of the jsenabled setting so that sessions without js are performance penalised instead of regular sessions.

This commit is contained in:
redmatrix
2016-04-12 22:55:26 -07:00
parent f4a27afee9
commit 91cc365143
8 changed files with 26 additions and 26 deletions

View File

@@ -149,19 +149,8 @@ $Router = new Zotlabs\Web\Router($a);
if(! x(App::$page, 'content'))
App::$page['content'] = '';
call_hooks('page_content_top', App::$page['content']);
if(! (App::$module === 'setup')) {
/* set JS cookie */
if($_COOKIE['jsAvailable'] != 1) {
App::$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;
}
}
call_hooks('page_content_top', App::$page['content']);
}
$Router->Dispatch($a);