Skip to content

Commit

Permalink
check if highlight_file is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
jakoch committed Sep 2, 2012
1 parent 010e42d commit c87ac68
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions framework/Koch/Exception/Errorhandler.php
Expand Up @@ -375,8 +375,13 @@ public static function getErrorContext($file, $line, $scope)
$lines_html = implode($lines_array, ' ');

// get ALL LINES syntax highlighted source-code of the file and explode it into an array
$array_content = explode('<br />', highlight_file($file, true));

// the if check is needed to workaround "highlight_file() has been disabled for security reasons"
if(function_exists('highlight_file') === true) {
$array_content = explode('<br />', highlight_file($file, true));
} else {
$array_content = explode('<br />', $file);
}

// get the ERROR SURROUNDING LINES from ALL LINES
$array_content_sliced = array_slice($array_content, $errorcontext_starting_line-1, $scope, true);

Expand Down

0 comments on commit c87ac68

Please sign in to comment.