diff --git a/core/lib/class.plx.plugins.php b/core/lib/class.plx.plugins.php index e2a464873..be4f3c5c5 100644 --- a/core/lib/class.plx.plugins.php +++ b/core/lib/class.plx.plugins.php @@ -30,13 +30,28 @@ public function __construct($default_lang='') { # For hiding sensitive informations $documentRoot = realpath($_SERVER['DOCUMENT_ROOT']); # resolve symbolic link with Linux $filename = $error['file']; - $newFolder = dirname($filename) . '-orig'; $hr = str_repeat('=', 60) . PHP_EOL; - header('Content-Type: text/plain; charset=UTF-8'); - - if(isset($this->rootPlugins) and preg_match('#^' . $this->rootPlugins . '/([^/]+)#', $error['file'], $matches)) { + $hasHeaders_sent = headers_sent(); + if(!$hasHeaders_sent and empty(ob_get_length())) { + header('Content-Type: text/plain; charset=UTF-8'); + } else { +?> +

+rootPlugins) and preg_match('#' . basename($this->rootPlugins) . '/([^/]+)/\1\.php$#', $error['file'], $matches)) {
 					$pluginName = $matches[1];
+					$newFolder = dirname($filename) . '-orig';
 ?>
 An error is occured with the "" plugin :
 $v) {
-						if($k == 'SCRIPT_FILENAME') {
-							$v = preg_replace('#^' . $documentRoot . '#', '', $v);
+						switch($k) {
+							case 'SCRIPT_FILENAME' : $v = preg_replace('#^' . $documentRoot . '#', '', realpath($v)); break;
+							case 'SERVER_SIGNATURE' : $v = trim(strip_tags($v)); break;
+							default : # nothing to do
+						}
+						if(!empty($v)) {
+							echo $k . ' : ' . $v . PHP_EOL;
 						}
-						echo $k . ' : ' . $v . PHP_EOL;
 					}
 
 					if(!empty($pluginName)) {
@@ -100,28 +119,35 @@ public function __construct($default_lang='') {
 ?>
 
 About this plugin :
-
+
 
 The folder of plugin is renamed to : rootPlugins . '/#', '', $newFolder) . PHP_EOL ?>
 Reload this page to continue ...
 
 Drop this plugin now for running PluXml and report to its author !!
+
+