diff --git a/lib/Sabberworm/CSS/Parser.php b/lib/Sabberworm/CSS/Parser.php index ccbba6ae..6466a2ef 100644 --- a/lib/Sabberworm/CSS/Parser.php +++ b/lib/Sabberworm/CSS/Parser.php @@ -540,7 +540,7 @@ private function consumeUntil($aEnd, $bIncludeEnd = false) { $aEnd = is_array($aEnd) ? $aEnd : array($aEnd); $iEndPos = null; foreach ($aEnd as $sEnd) { - $iCurrentEndPos = mb_strpos($this->sText, $sEnd, $this->iCurrentPosition, $this->sCharset); + $iCurrentEndPos = $this->strpos($this->sText, $sEnd, $this->iCurrentPosition, $this->sCharset); if($iCurrentEndPos === false) { continue; } @@ -574,4 +574,12 @@ private function strlen($text) { } } + private function strpos($text, $needle, $offset, $charset) { + if ($this->oParserSettings->bMultibyteSupport) { + return mb_strpos($text, $needle, $offset, $charset); + } else { + return strpos($text, $needle, $offset); + } + } + }