PluginProbe
CSS & JavaScript Toolbox / 7.2
CSS & JavaScript Toolbox v7.2
trunk 0.3 0.8 10 10.1 11 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 11.9.1 12 12.0 12.0.1 12.0.3 12.0.4 12.0.5 12.0.6 12.0.7 6.0 6.0.11 All 60 releases
← All changes | framework/php/evaluator/evaluator.inc.php +12 -7 6.07.2 View file →
@@ -48,18 +48,23 @@
48 48 ob_start();
49 49 // Evaluate PHP code and save the result!
50 50 $beforeEvalError = error_get_last();
51 51 $unusedResult = eval("?>{$code}");
52 + $afterEvalError = error_get_last();
52 53 $evalOBuffer = ob_get_clean();
54 + $showError = ini_get('display_errors') && WP_DEBUG;
55 + $isError = $afterEvalError && ($beforeEvalError != $afterEvalError);
53 56 // Handling errors!
54 - if ($beforeEvalError != error_get_last()) {
55 - if (ini_get('display_errors')) {
56 - $this->output = 'CJT PHP Code Error detected for the following block: <br><br>';
57 - $this->output .= "Name: {$block->name}<br>";
58 - $this->output .= "ID: #{$block->id}<br><br>";
59 - $this->output .= "PHP Error Details are listed below:<br>";
57 + if ($isError && $showError) {
58 + $this->output = 'CJT PHP Code Error detected for the following block: <br><br>';
59 + $this->output .= "Name: {$block->name}<br>";
60 + $this->output .= "ID: #{$block->id}<br><br>";
61 + if ($evalOBuffer) {
62 + $this->output .= "PHP Error message:<br>";
60 63 $this->output .= $evalOBuffer;
61 64 }
65 + $this->output .= "PHP Error tech Details:<br>";
66 + $this->output .= print_r($afterEvalError, true);
62 67 }
63 68 else { // Get evaludated code result!
64 69 $this->output .= $evalOBuffer;
65 70 }
@@ -89,5 +94,5 @@
89 94 */
90 95 public function getOutput() {
91 96 return $this->output;
92 97 }
93 -} // End class.
98 +} // End class.