Skip to content

Commit

Permalink
Toggle for displaying fatal error and PLX_DEBUG set to false (#828)
Browse files Browse the repository at this point in the history
Co-authored-by: Jean-Pierre Pourrez <kazimentou@free.fr>
  • Loading branch information
kazimentou and bazooka07 authored Aug 27, 2024
1 parent 3d6965f commit 6456d87
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
23 changes: 20 additions & 3 deletions core/lib/class.plx.plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ public function __construct($default_lang='') {
header('Content-Type: text/plain; charset=UTF-8');
} else {
?>
<pre id="fatal-error" style="
<style>
#bug-notification:not(:checked) + div {
display: none;
}
</style>
<input type="checkbox" id="bug-notification" checked style="display: none;"/>
<div id="fatal-error" style="
position: fixed;
top: 10vh;
width: 80rem;
Expand All @@ -46,7 +52,9 @@ public function __construct($default_lang='') {
padding: 0.5rem 1rem;
background-color: #555;
color: lime;
"><code>
z-index: 999;
">
<pre><code>
<?php
}
if(isset($this->rootPlugins) and preg_match('#' . basename($this->rootPlugins) . '/([^/]+)/\1\.php$#', $error['file'], $matches)) {
Expand Down Expand Up @@ -79,7 +87,7 @@ public function __construct($default_lang='') {
User : <?= $_SESSION['user'] . PHP_EOL ?>
Profil : <?= $_SESSION['profil'] . PHP_EOL ?>
PluXml version : <?= PLX_VERSION . PHP_EOL ?>
PLX_DEBUG : <?= PLX_DEBUG ? 'true' : 'false' ?>
PLX_DEBUG : <?= ( PLX_DEBUG ? 'true' : 'false' ) . PHP_EOL ?>
PHP version : <?= PHP_VERSION . PHP_EOL ?>
<?= $hr ?>
About this server :
Expand All @@ -104,6 +112,7 @@ public function __construct($default_lang='') {
));
}, ARRAY_FILTER_USE_KEY) as $k=>$v) {
switch($k) {
case 'HTTP_REFERER' : $v = preg_replace('#^https?://'. $_SERVER['SERVER_NAME']. '#', '', $_SERVER['HTTP_REFERER']); break;
case 'SCRIPT_FILENAME' : $v = preg_replace('#^' . $documentRoot . '#', '', realpath($v)); break;
case 'SERVER_SIGNATURE' : $v = trim(strip_tags($v)); break;
default : # nothing to do
Expand Down Expand Up @@ -145,6 +154,14 @@ public function __construct($default_lang='') {
if($hasHeaders_sent) {
?>
</code></pre>
<label for="bug-notification" style="
position: absolute;
top: 0.25rem;
right: 0.25rem;
padding: 0.2rem;
background-color: #eee;
">❌</label>
</div>
<?php
}
}
Expand Down
4 changes: 2 additions & 2 deletions core/lib/config.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
const PLX_DEBUG = true;
const PLX_VERSION = '5.8.15';
const PLX_DEBUG = false;
const PLX_VERSION = '5.8.16';
const PLX_URL_REPO = 'https://www.pluxml.org';
const PLX_URL_VERSION = PLX_URL_REPO.'/download/latest-version.txt';

Expand Down
4 changes: 4 additions & 0 deletions readme/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## PLUXML 5.8.16 (2024/08/27)
[+] toggle display for fatal error
[+] PLX_DEBUG is set to "false"

## PLUXML 5.8.15 (2024/07/18)
[+] plxAdmin::getFileStatique() always returns a string
[+] PLX_DEBUG is set to "true"
Expand Down
1 change: 1 addition & 0 deletions update/versions.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@
'5.8.12' => '',
'5.8.13' => '',
'5.8.14' => '',
'5.8.15' => '',
);

0 comments on commit 6456d87

Please # to comment.