Correct line numbers in error source fragment view

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60608 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-08-13 03:54:50 +00:00
parent ab6d6dd32f
commit 7f72a0120b

View File

@ -314,6 +314,11 @@ class Debug {
$reporter->writeError($httpRequest, $errno, $errstr, $errfile, $errline, $errcontext);
$lines = file($errfile);
// Make the array 1-based
array_unshift($lines,"");
unset($lines[0]);
$offset = $errline-10;
$lines = array_slice($lines, $offset, 16, true);
$reporter->writeSourceFragment($lines, $errline);