diff --git a/application/views/home/index.php b/application/views/home/index.php index 59b997e8..a03814de 100644 --- a/application/views/home/index.php +++ b/application/views/home/index.php @@ -63,7 +63,7 @@
You have successfully installed Laravel. - +

Perhaps you would like to peruse the documentation or contribute on GitHub? diff --git a/system/error.php b/system/error.php index 2520a8a4..c8a7c2c1 100644 --- a/system/error.php +++ b/system/error.php @@ -3,7 +3,7 @@ class Error { /** - * Error levels. + * Error levels and descriptions. * * @var array */ @@ -32,7 +32,8 @@ class Error { public static function handle($e) { // ----------------------------------------------------- - // Clean the output buffer. + // Clean the output buffer. We don't want any rendered + // views or text to be sent to the browser. // ----------------------------------------------------- if (ob_get_level() > 0) { @@ -40,7 +41,7 @@ public static function handle($e) } // ----------------------------------------------------- - // Get the error severity. + // Get the error severity in human readable format. // ----------------------------------------------------- $severity = (array_key_exists($e->getCode(), static::$levels)) ? static::$levels[$e->getCode()] : $e->getCode(); @@ -57,19 +58,21 @@ public static function handle($e) $file = $e->getFile(); } - // ----------------------------------------------------- - // Trim the period off of the error message. - // ----------------------------------------------------- $message = rtrim($e->getMessage(), '.'); - // ----------------------------------------------------- - // Log the error. - // ----------------------------------------------------- if (Config::get('error.log')) { Log::error($message.' in '.$e->getFile().' on line '.$e->getLine()); } + // ----------------------------------------------------- + // Detailed error view contains the file name and stack + // trace of the error. It is not wise to have details + // enabled in a production environment. + // + // The generic error view (error/500) only has a simple, + // generic error message suitable for production. + // ----------------------------------------------------- if (Config::get('error.detail')) { $view = View::make('exception') @@ -107,24 +110,16 @@ private static function context($path, $line, $padding = 5) array_unshift($file, ''); // ----------------------------------------------------- - // Calculate the starting position. + // Calculate the starting position of the file context. // ----------------------------------------------------- $start = $line - $padding; - - if ($start < 0) - { - $start = 0; - } + $start = ($start < 0) ? 0 : $start; // ----------------------------------------------------- // Calculate the context length. // ----------------------------------------------------- $length = ($line - $start) + $padding + 1; - - if (($start + $length) > count($file) - 1) - { - $length = null; - } + $length = (($start + $length) > count($file) - 1) ? null : $length; return array_slice($file, $start, $length, true); }