Skip to content
Snippets Groups Projects
Commit a8cf30ef authored by Marius van Witzenburg's avatar Marius van Witzenburg
Browse files

Prevent undefined error by checking on slen

parent 5c97ad3a
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment