diff --git a/patches.txt b/patches.txt index 85c95658a..e2c9c1373 100644 --- a/patches.txt +++ b/patches.txt @@ -9,3 +9,4 @@ Patches: - SabreXML: Fix invalid PHP docs https://github.com/fruux/sabre-xml/pull/128 - SabreXML: Prevent infinite loops for empty props element https://github.com/fruux/sabre-xml/pull/132 - ZipStreamer: Fix zip generation for 7zip https://github.com/McNetic/PHPZipStreamer/pull/39 +- scssphp: Fix Trying to access array offset on value of type null https://github.com/scssphp/scssphp/commit/05a5d11ea7f68c52fdb6a5ca35cf46613b608445 diff --git a/scssphp/scssphp/src/Compiler.php b/scssphp/scssphp/src/Compiler.php index 8655ef9df..6e4b729ec 100644 --- a/scssphp/scssphp/src/Compiler.php +++ b/scssphp/scssphp/src/Compiler.php @@ -2712,7 +2712,6 @@ protected function shouldEval($value) */ protected function reduce($value, $inExp = false) { - switch ($value[0]) { case Type::T_EXPRESSION: list(, $op, $left, $right, $inParens) = $value; @@ -6170,10 +6169,10 @@ protected function libStrLength($args) return new Node\Number(strlen($stringContent), ''); } - protected static $libStrSlice = ['string', 'start-at', 'end-at:null']; + protected static $libStrSlice = ['string', 'start-at', 'end-at:-1']; protected function libStrSlice($args) { - if (isset($args[2]) && $args[2][1] == 0) { + if (isset($args[2]) && ! $args[2][1]) { return static::$nullString; } @@ -6186,7 +6185,7 @@ protected function libStrSlice($args) $start--; } - $end = (int) $args[2][1]; + $end = isset($args[2]) ? (int) $args[2][1] : -1; $length = $end < 0 ? $end + 1 : ($end > 0 ? $end - $start : $end); $string[2] = $length