Skip to content

Commit

Permalink
Update deprecated use of preg_match*() flags
Browse files Browse the repository at this point in the history
  • Loading branch information
rainerkraftmb committed Dec 6, 2022
1 parent cc5dd97 commit 771d21c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lessc.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -3605,7 +3605,7 @@ protected function match($regex, &$out, $eatWhitespace = null) {
if ($eatWhitespace === null) $eatWhitespace = $this->eatWhiteDefault;

$r = '/'.$regex.($eatWhitespace && !$this->writeComments ? '\s*' : '').'/Ais';
if (preg_match($r, $this->buffer, $out, null, $this->count)) {
if (preg_match($r, $this->buffer, $out, 0, $this->count)) {
$this->count += strlen($out[0]);
if ($eatWhitespace && $this->writeComments) $this->whitespace();
return true;
Expand All @@ -3617,7 +3617,7 @@ protected function match($regex, &$out, $eatWhitespace = null) {
protected function whitespace() {
if ($this->writeComments) {
$gotWhite = false;
while (preg_match(self::$whitePattern, $this->buffer, $m, null, $this->count)) {
while (preg_match(self::$whitePattern, $this->buffer, $m, 0, $this->count)) {
if (isset($m[1]) && empty($this->seenComments[$this->count])) {
$this->append(array("comment", $m[1]));
$this->seenComments[$this->count] = true;
Expand All @@ -3636,7 +3636,7 @@ protected function whitespace() {
protected function peek($regex, &$out = null, $from=null) {
if (is_null($from)) $from = $this->count;
$r = '/'.$regex.'/Ais';
$result = preg_match($r, $this->buffer, $out, null, $from);
$result = preg_match($r, $this->buffer, $out, 0, $from);

return $result;
}
Expand Down
2 changes: 1 addition & 1 deletion lessify.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function preg_quote($what) {

public function match($regex, &$out, $eatWhitespace = true) {
$r = '/'.$regex.($eatWhitespace ? '\s*' : '').'/Ais';
if (preg_match($r, $this->buffer, $out, null, $this->count)) {
if (preg_match($r, $this->buffer, $out, 0, $this->count)) {
$this->count += strlen($out[0]);
return true;
}
Expand Down

0 comments on commit 771d21c

Please sign in to comment.