Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix in plxAdmin::getFileStatique() and plxPlugins::__construct() #827

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions core/lib/class.plx.admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -840,14 +840,15 @@ public function getFileStatique($num) {
# Emplacement de la page
$filename = PLX_ROOT.$this->aConf['racine_statiques'].$num.'.'.$this->aStats[ $num ]['url'].'.php';
if(file_exists($filename) AND filesize($filename) > 0) {
if($f = fopen($filename, 'r')) {
$content = fread($f, filesize($filename));
fclose($f);
$content = file_get_contents($filename);
if(is_string($content)) {
# On retourne le contenu
return $content;
} else {
return implode(PHP_EOL, array('<p>', "\t" . L_UNKNOWN_ERROR, '</p>'));
}
}
return null;
return implode(PHP_EOL, array('<p>', "\t" . L_STATICS_NEW_PAGE, '</p>'));
}

/**
Expand Down
3 changes: 2 additions & 1 deletion core/lib/class.plx.plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct($default_lang='') {

register_shutdown_function(function() {
$error = error_get_last();
if($error != null) {
if($error != null and !empty($error['file']) and (PLX_DEBUG or $error['type'] < E_DEPRECATED)) { # error['type'] < 8192
# For hiding sensitive informations
$documentRoot = realpath($_SERVER['DOCUMENT_ROOT']); # resolve symbolic link with Linux
$filename = $error['file'];
Expand Down Expand Up @@ -79,6 +79,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' ?>
PHP version : <?= PHP_VERSION . PHP_EOL ?>
<?= $hr ?>
About this server :
Expand Down
2 changes: 1 addition & 1 deletion 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.14';
const PLX_VERSION = '5.8.15';
const PLX_URL_REPO = 'https://www.pluxml.org';
const PLX_URL_VERSION = PLX_URL_REPO.'/download/latest-version.txt';

Expand Down
5 changes: 5 additions & 0 deletions readme/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## PLUXML 5.8.15 (2024/07/18)
[+] plxAdmin::getFileStatique() always returns a string
[+] PLX_DEBUG is set to "true"
[+] In plxPlugins::__construct(), error is ignored in some cases

## PLUXML 5.8.14 (2024/05/15)
[+] date_creation or date_update may be missing in a file of article

Expand Down