| @@ -48,23 +48,18 @@ | ||
| 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(); | |
| 53 | 52 | $evalOBuffer = ob_get_clean(); |
| 54 | - $showError = ini_get('display_errors') && WP_DEBUG; | |
| 55 | - $isError = $afterEvalError && ($beforeEvalError != $afterEvalError); | |
| 56 | 53 | // Handling errors! |
| 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>"; | |
| 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>"; | |
| 63 | 60 | $this->output .= $evalOBuffer; |
| 64 | 61 | } |
| 65 | - $this->output .= "PHP Error tech Details:<br>"; | |
| 66 | - $this->output .= print_r($afterEvalError, true); | |
| 67 | 62 | } |
| 68 | 63 | else { // Get evaludated code result! |
| 69 | 64 | $this->output .= $evalOBuffer; |
| 70 | 65 | } |
| @@ -94,5 +89,5 @@ | ||
| 94 | 89 | */ |
| 95 | 90 | public function getOutput() { |
| 96 | 91 | return $this->output; |
| 97 | 92 | } |
| 98 | -} // End class. | |
| 93 | +} // End class. | |