From a8cf30effe4814a627768fc14485ebbd4161faa1 Mon Sep 17 00:00:00 2001 From: Marius van Witzenburg <info@mariusvw.com> Date: Tue, 8 Sep 2015 11:24:53 +0200 Subject: [PATCH] Prevent undefined error by checking on slen --- lib/exe/js.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/exe/js.php b/lib/exe/js.php index 7a956b7c9..e850218cf 100644 --- a/lib/exe/js.php +++ b/lib/exe/js.php @@ -419,7 +419,7 @@ function js_compress($s){ // Only consider deleting whitespace if the signs before and after // are not equal and are not an operator which may not follow itself. - if (isset($s[$i+1]) && ((!$lch || $s[$i+1] == ' ') + if ($i+1 < $slen && ((!$lch || $s[$i+1] == ' ') || $lch != $s[$i+1] || strpos($ops,$s[$i+1]) === false)) { // leading spaces -- GitLab