Skip to content

Commit 067ef1c

Browse files
committed
Fix PHP 7.3 warning when using count() on non-array value
1 parent 91bcc3e commit 067ef1c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Sabberworm/CSS/Parsing/ParserState.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ public function __construct($sText, Settings $oParserSettings, $iLineNo = 1) {
2727
public function setCharset($sCharset) {
2828
$this->sCharset = $sCharset;
2929
$this->aText = $this->strsplit($this->sText);
30-
$this->iLength = count($this->aText);
30+
if( is_array($this->aText) ) {
31+
$this->iLength = count($this->aText);
32+
}
3133
}
3234

3335
public function getCharset() {

0 commit comments

Comments
 (0)