33
2
mirror of https://github.com/joomla-extensions/jedchecker.git synced 2024-11-27 23:36:38 +00:00

Merge pull request #76 into joomla/develop

This commit is contained in:
Llewellyn van der Merwe 2021-03-07 02:08:19 +02:00
commit ebb388a5c7
Signed by: Llewellyn
GPG Key ID: EFC0C720A240551C

View File

@ -400,11 +400,7 @@ class JedcheckerRulesJamss extends JEDcheckerRule
*/
private function calculate_line_number($offset, $file_content)
{
// Fetches all the text before the match
list($first_part) = str_split($file_content, $offset);
$line_nr = strlen($first_part) - strlen(str_replace("\n", "", $first_part)) + 1;
return $line_nr;
return substr_count($file_content, "\n", 0, $offset) + 1;
}
/**