Skip to content

Commit 299af46

Browse files
committed
more improvements
1 parent 42d4e35 commit 299af46

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

scripts/dev/check_parameters.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
define('REPORT_LEVEL', 2); // 0 reports less false-positives. up to level 5.
2424
define('VERSION', '5.2'); // minimum is 5.2
25-
define('PHPDIR', dirname(__FILE__) . '/../..');
25+
define('PHPDIR', realpath(dirname(__FILE__) . '/../..'));
2626

2727

2828
// be sure you have enough memory and stack for PHP. pcre will push the limits!
@@ -64,7 +64,12 @@ function error($str, $level = 0)
6464
global $current_file, $current_function, $line;
6565

6666
if ($level <= REPORT_LEVEL) {
67-
echo substr($current_file, strlen(PHPDIR)+1) . " [$line] $current_function : $str\n";
67+
if (strpos($current_file,PHPDIR) === 0) {
68+
$filename = substr($current_file, strlen(PHPDIR)+1);
69+
} else {
70+
$filename = $current_file;
71+
}
72+
echo $filename , " [$line] $current_function : $str\n";
6873
}
6974
}
7075

@@ -364,5 +369,5 @@ function recurse($path)
364369
}
365370

366371
foreach ($dirs as $dir) {
367-
recurse($dir);
372+
recurse(realpath($dir));
368373
}

0 commit comments

Comments
 (0)