X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Flibs%2FJavaScriptMinifier.php;h=43cd7db2d1e08947454ee1cf85ee412623f3dc1f;hb=e0193327bd2661fc68a7b3541cf977f2baf0ac4f;hp=a1a93d2b4673fb3d4b9e6e3d6f6c92d51a3df079;hpb=e69bcfad17d67da5113cdd75276a5f7b5cefb123;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/JavaScriptMinifier.php b/includes/libs/JavaScriptMinifier.php index a1a93d2b46..43cd7db2d1 100644 --- a/includes/libs/JavaScriptMinifier.php +++ b/includes/libs/JavaScriptMinifier.php @@ -4,7 +4,10 @@ * * @file * @author Paul Copperman - * @license Choose any of Apache, MIT, GPL, LGPL + * @license Apache-2.0 + * @license MIT + * @license GPL-2.0-or-later + * @license LGPL-2.1-or-later */ /** @@ -498,6 +501,13 @@ class JavaScriptMinifier { } while ( $end - 2 < $length && $s[$end - 2] === '\\' ); // Correction (1): Undo speculative add, keep only one (end of regexp) $end--; + if ( $end > $length ) { + // Correction (2): Loop wrongly assumed "]" was seen + // String ended without ending char class or regexp. Correct $end. + // TODO: This is invalid and should throw. + $end--; + break; + } } // Search past the regexp modifiers (gi) while ( $end < $length && ctype_alpha( $s[$end] ) ) {