Stronger typing on error views to avoid E_FATAL and hide exceptions if display_except...
authorMarco Pivetta <ocramius@gmail.com>
Wed, 23 Nov 2011 23:07:16 +0000 (00:07 +0100)
committerMarco Pivetta <ocramius@gmail.com>
Wed, 23 Nov 2011 23:07:16 +0000 (00:07 +0100)
module/Application/views/error/404.phtml
module/Application/views/error/index.phtml

index cf9b486..a08996b 100644 (file)
@@ -1,14 +1,20 @@
-<h1>An 404 error occurred</h1>
+<h1>A 404 error occurred</h1>
 <h2><?php echo $this->message ?></h2>
 
-<?php if (isset($this->exception)): ?>
+<?php if (isset($this->display_exceptions) && $this->display_exceptions): ?>
+
+<?php if(isset($this->exception) && $this->exception instanceof Exception): ?>
 
 <h3>Exception information:</h3>
 <p>
-    <b>Message:</b> <?php echo $this->exception->getMessage() ?>
+    <h3>Stack trace:</h3>
+    <pre><?php echo $this->exception->getTraceAsString() ?></pre>
 </p>
 
-<h3>Stack trace:</h3>
-<pre><?php echo $this->exception->getTraceAsString() ?></pre>
+<?php else: ?>
+
+<h3>No Exception available</h3>
 
 <?php endif ?>
+
+<?php endif ?>
\ No newline at end of file
index 454b615..b05d316 100644 (file)
@@ -1,14 +1,20 @@
 <h1>An error occurred</h1>
 <h2><?php echo $this->message ?></h2>
 
-<?php if (isset($this->exception)): ?>
+<?php if (isset($this->display_exceptions) && $this->display_exceptions): ?>
+
+<?php if(isset($this->exception) && $this->exception instanceof Exception): ?>
 
 <h3>Exception information:</h3>
 <p>
-    <b>Message:</b> <?php echo $this->exception->getMessage() ?>
+    <h3>Stack trace:</h3>
+    <pre><?php echo $this->exception->getTraceAsString() ?></pre>
 </p>
 
-<h3>Stack trace:</h3>
-<pre><?php echo $this->exception->getTraceAsString() ?></pre>
+<?php else: ?>
+
+<h3>No Exception available</h3>
 
 <?php endif ?>
+
+<?php endif ?>
\ No newline at end of file