Skip to content

Commit

Permalink
Fix PHP 8.1 compatibility in ParserState::strsplit()
Browse files Browse the repository at this point in the history
> Error Message: preg_split(): Passing null to parameter MyIntervals#3 ($limit) of type int is deprecated

see MyIntervals#338

(cherry picked from commit 84b3ba7)
  • Loading branch information
TimWolla committed Oct 29, 2021
1 parent d217848 commit 2c397c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Sabberworm/CSS/Parsing/ParserState.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ private function strtolower($sString) {
private function strsplit($sString) {
if ($this->oParserSettings->bMultibyteSupport) {
if ($this->streql($this->sCharset, 'utf-8')) {
return preg_split('//u', $sString, null, PREG_SPLIT_NO_EMPTY);
return preg_split('//u', $sString, -1, PREG_SPLIT_NO_EMPTY);
} else {
$iLength = mb_strlen($sString, $this->sCharset);
$aResult = array();
Expand All @@ -307,4 +307,4 @@ private function strpos($sString, $sNeedle, $iOffset) {
return strpos($sString, $sNeedle, $iOffset);
}
}
}
}

0 comments on commit 2c397c3

Please sign in to comment.