Skip to content

Commit

Permalink
fix path issue when framework root is not webroot
Browse files Browse the repository at this point in the history
  • Loading branch information
ikkez committed Dec 6, 2020
1 parent 419e6da commit cf2a855
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/Falsum/Run.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
* Christian Knuth <ikkez0n3@gmail.com>
* https://github.com/ikkez/f3-falsum
*
* @version 2.8.0
* @date: 11.07.2019
* @version 2.8.1
* @date: 06.012.2020
* @author: Rafael Santos, https://github.com/rafamds
**/

Expand Down Expand Up @@ -85,8 +85,14 @@ public static function handleError(\Base $fw) {
$line_start=$line-6;
$line_end=$line+6;

$path = $fw->get('ROOT').'/';
$rows=file(realpath($path.$errors[$key]['file']));
$filePath = $errors[$key]['file'];
if (!is_file($filePath))
$filePath=$fw->get('ROOT').'/'.$filePath;
if (!is_file($filePath)) {
$errors[$key]['script']='';
continue;
}
$rows=file($filePath);
$errors[$key]['script']='<div class="code-wrap">';
$errors[$key]['script'].='<pre class="excerpt">'.$eol;
for ($pos=$line_start;$pos<=$line_end;$pos++) {
Expand Down

0 comments on commit cf2a855

Please sign in to comment.