diff --git a/libraries/error_report.lib.php b/libraries/error_report.lib.php index 1feb30fbe7..7e5841f2f8 100644 --- a/libraries/error_report.lib.php +++ b/libraries/error_report.lib.php @@ -164,7 +164,21 @@ function PMA_sendErrorReport($report) { function PMA_countLines($filename) { global $LINE_COUNT; - return $LINE_COUNT[$filename]; + if (!defined('LINE_COUNTS')) { + $linecount = 0; + $handle = fopen('./js/' . $filename, 'r'); + while (!feof($handle)){ + $line = fgets($handle); + if ($line === false) { + break; + } + $linecount++; + } + fclose($handle); + return $linecount; + } else { + return $LINE_COUNT[$filename]; + } } /**