aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKirill Nesmeyanov <nesk@xakep.ru>2017-07-25 21:28:49 +0300
committerGitHub <noreply@github.com>2017-07-25 21:28:49 +0300
commit75a95809df5a5ce2e0922ea13699053c53c42780 (patch)
tree6dbd49cfb1cff421293092ecf2328abf0f1b4067
parent4730a839280539e42ba6ef69fa5ce1b64be43b9d (diff)
downloadCompiler-75a95809df5a5ce2e0922ea13699053c53c42780.zip
Compiler-75a95809df5a5ce2e0922ea13699053c53c42780.tar.gz
Compiler-75a95809df5a5ce2e0922ea13699053c53c42780.tar.bz2
Update Parser.php
Fix "strrpos()" bug when offset is greater than the length of haystack string
-rw-r--r--Llk/Parser.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/Llk/Parser.php b/Llk/Parser.php
index 7223067..ee3588c 100644
--- a/Llk/Parser.php
+++ b/Llk/Parser.php
@@ -192,7 +192,7 @@ class Parser
$column = 1;
if (!empty($text)) {
- if (0 === $offset) {
+ if (0 === $offset || null === $offset) {
$leftnl = 0;
} else {
$leftnl = strrpos($text, "\n", -(strlen($text) - $offset) - 1) ?: 0;