Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable18] Fix Trying to access array offset on value of type null notice #442

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions leafo/scssphp/src/Compiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -5214,7 +5214,7 @@ protected function libStrLength($args)
protected static $libStrSlice = ['string', 'start-at', 'end-at'];
protected function libStrSlice($args)
{
if (isset($args[2]) && $args[2][1] == 0) {
if (isset($args[2]) && ! $args[2][1]) {
return static::$nullString;
}

Expand All @@ -5227,7 +5227,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
Expand Down
1 change: 1 addition & 0 deletions patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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