From 2b0a04ea9e91196e2966844be0f6b673bd87f032 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 20 Apr 2016 22:10:00 -0700 Subject: revert the reversal of checkjs logic, but still restrict the behaviour scope to just those urls that require it --- Zotlabs/Web/CheckJS.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'Zotlabs/Web') diff --git a/Zotlabs/Web/CheckJS.php b/Zotlabs/Web/CheckJS.php index 3ad5fc1ed..50af34a40 100644 --- a/Zotlabs/Web/CheckJS.php +++ b/Zotlabs/Web/CheckJS.php @@ -10,14 +10,27 @@ class CheckJS { function __construct($test = 0) { if(intval($_REQUEST['jsdisabled'])) $this->jsdisabled = 1; + else + $this->jsdisabled = 0; if(intval($_COOKIE['jsdisabled'])) $this->jsdisabled = 1; + else + $this->jsdisabled = 0; if(! $this->jsdisabled) { $page = urlencode(\App::$query_string); if($test) { - \App::$page['htmlhead'] .= "\r\n" . '' . "\r\n"; + + logger('page=' . $page); + + if($_COOKIE['jsdisabled'] == 0) { + \App::$page['htmlhead'] .= "\r\n" . '' . "\r\n"; + /* emulate JS cookie if cookies are not accepted */ + if ($_GET['jsdisabled'] == 0) { + $_COOKIE['jsdisabled'] = 0; + } + } } else { \App::$page['htmlhead'] .= "\r\n" . '' . "\r\n"; -- cgit v1.2.3