mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-03 17:44:48 +02:00
core: Add Debug::isEnabled() and Debug::isSecure()
Also adds documentation to Debug.php! * Debug::isEnabled() Checks if the DEBUG file exists on disk on the first call (stored in memory for the duration of the instance). Returns true if debug mode is enabled for the client. This function also sets the internal flag for Debug::isSecure()! * Debug::isSecure() Returns true if debuging is enabled for specific IP addresses, false otherwise. This is checked on the first call of Debug::isEnabled(). If you call this function before Debug::isEnabled(), the default value is false.
This commit is contained in:
parent
c63af2e7ad
commit
a0490e3673
5 changed files with 87 additions and 36 deletions
|
@ -57,16 +57,16 @@ EOD;
|
|||
private static function getHeader() {
|
||||
$warning = '';
|
||||
|
||||
if(defined('DEBUG') && DEBUG === true) {
|
||||
if(defined('DEBUG_INSECURE') && DEBUG_INSECURE === true) {
|
||||
if(Debug::isEnabled()) {
|
||||
if(!Debug::isSecure()) {
|
||||
$warning .= <<<EOD
|
||||
<section class="critical-warning">Warning : Debug mode is active from any location,
|
||||
make sure only you can access RSS-Bridge.</section>
|
||||
<section class="critical-warning">Warning : Debug mode is active from any location,
|
||||
make sure only you can access RSS-Bridge.</section>
|
||||
EOD;
|
||||
} else {
|
||||
$warning .= <<<EOD
|
||||
<section class="warning">Warning : Debug mode is active from your IP address,
|
||||
your requests will bypass the cache.</section>
|
||||
<section class="warning">Warning : Debug mode is active from your IP address,
|
||||
your requests will bypass the cache.</section>
|
||||
EOD;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue