mirror of
https://github.com/YunoHost-Apps/hubzilla_ynh.git
synced 2024-09-03 19:26:21 +02:00
36 lines
727 B
PHP
36 lines
727 B
PHP
<?php
|
|
|
|
namespace Zotlabs\Web;
|
|
|
|
|
|
class CheckJS {
|
|
|
|
private static $jsdisabled = 0;
|
|
|
|
function __construct($test = 0) {
|
|
if(intval($_REQUEST['jsdisabled']))
|
|
$this->jsdisabled = 1;
|
|
if(intval($_COOKIE['jsdisabled']))
|
|
$this->jsdisabled = 1;
|
|
|
|
if(! $this->jsdisabled) {
|
|
$page = urlencode(\App::$query_string);
|
|
|
|
if($test) {
|
|
\App::$page['htmlhead'] .= "\r\n" . '<meta http-equiv="refresh" content="0; url=' . z_root() . '/nojs?f=&redir=' . $page . '">' . "\r\n";
|
|
}
|
|
else {
|
|
\App::$page['htmlhead'] .= "\r\n" . '<noscript><meta http-equiv="refresh" content="0; url=' . z_root() . '/nojs?f=&redir=' . $page . '"></noscript>' . "\r\n";
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function disabled() {
|
|
return self::$jsdisabled;
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|