Skip to content

Commit b4d648d

Browse files
committed
PHP8 fix part 4: Trying to access array offset on value of type bool/null
Original commit: dokuwiki/dokuwiki@aac83cd
2 parents eb6f063 + 68f6057 commit b4d648d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/exe/js.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ function js_compress($s){
418418
// double quote strings
419419
if($ch == '"'){
420420
$j = 1;
421-
while( $s[$i+$j] != '"' && ($i+$j < $slen)){
421+
while( ($i+$j < $slen) && $s[$i+$j] != '"' ){
422422
if( $s[$i+$j] == '\\' && ($s[$i+$j+1] == '"' || $s[$i+$j+1] == '\\') ){
423423
$j += 2;
424424
}else{
@@ -436,7 +436,7 @@ function js_compress($s){
436436
// single quote strings
437437
if($ch == "'"){
438438
$j = 1;
439-
while( $s[$i+$j] != "'" && ($i+$j < $slen)){
439+
while( ($i+$j < $slen) && $s[$i+$j] != "'" ){
440440
if( $s[$i+$j] == '\\' && ($s[$i+$j+1] == "'" || $s[$i+$j+1] == '\\') ){
441441
$j += 2;
442442
}else{

0 commit comments

Comments
 (0)