Browse Source

update ExceptionRenderer

antograssiot 11 years ago
parent
commit
ae00446c5e

+ 1 - 1
src/Error/ExceptionRenderer.php

@@ -143,7 +143,7 @@ class ExceptionRenderer {
 		}
 		$this->controller->response->statusCode($code);
 		$this->controller->set(array(
-			'message' => h($message),
+			'message' => $message,
 			'url' => h($url),
 			'error' => $exception,
 			'code' => $code,

+ 2 - 1
tests/TestCase/Error/ExceptionRendererTest.php

@@ -423,13 +423,14 @@ class ExceptionRendererTest extends TestCase {
  * @return void
  */
 	public function testError500Message() {
-		$exception = new InternalErrorException('An Internal Error Has Occurred');
+		$exception = new InternalErrorException('An Internal Error Has Occurred.');
 		$ExceptionRenderer = new ExceptionRenderer($exception);
 		$ExceptionRenderer->controller->response = $this->getMock('Cake\Network\Response', array('statusCode', '_sendHeader'));
 		$ExceptionRenderer->controller->response->expects($this->once())->method('statusCode')->with(500);
 
 		$result = $ExceptionRenderer->render();
 		$this->assertContains('<h2>An Internal Error Has Occurred</h2>', $result->body());
+		$this->assertContains('An Internal Error Has Occurred.</p>', $result->body());
 	}
 
 /**

+ 2 - 2
tests/test_app/TestApp/Template/Error/error500.ctp

@@ -14,10 +14,10 @@
  */
 use Cake\Core\Configure;
 ?>
-<h2><?= __d('cake', 'An Internal Error Has Occurred.') ?></h2>
+<h2><?= __d('cake', 'An Internal Error Has Occurred') ?></h2>
 <p class="error">
 	<strong><?= __d('cake', 'Error') ?>: </strong>
-	<?= h($message, false) ?>
+	<?= h($message) ?>
 </p>
 <?php
 if (Configure::read('debug')):