From 48a4d362f6d0173f153c8f3f21346f2d458a16c4 Mon Sep 17 00:00:00 2001 From: SharkyKZ Date: Mon, 5 Aug 2019 21:59:23 +0300 Subject: [PATCH] Replace curly braces for PHP 7.4 compat --- lessc.inc.php | 8 ++++---- lessify.inc.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lessc.inc.php b/lessc.inc.php index 37988952..90fac1aa 100644 --- a/lessc.inc.php +++ b/lessc.inc.php @@ -746,7 +746,7 @@ protected function compileProp($prop, $block, $out) { if ($suffix !== null && $subProp[0] == "assign" && is_string($subProp[1]) && - $subProp[1]{0} != $this->vPrefix + $subProp[1][0] != $this->vPrefix ) { $subProp[2] = array( 'list', ' ', @@ -1963,7 +1963,7 @@ protected function injectVariables($args) { $this->pushEnv(); $parser = new lessc_parser($this, __METHOD__); foreach ($args as $name => $strValue) { - if ($name{0} !== '@') { + if ($name[0] !== '@') { $name = '@' . $name; } $parser->count = 0; @@ -2624,7 +2624,7 @@ protected function parseChunk() { $hidden = true; if (!isset($block->args)) { foreach ($block->tags as $tag) { - if (!is_string($tag) || $tag{0} != $this->lessc->mPrefix) { + if (!is_string($tag) || $tag[0] != $this->lessc->mPrefix) { $hidden = false; break; } @@ -2678,7 +2678,7 @@ protected function isDirective($dirname, $directives) { protected function fixTags($tags) { // move @ tags out of variable namespace foreach ($tags as &$tag) { - if ($tag{0} == $this->lessc->vPrefix) + if ($tag[0] == $this->lessc->vPrefix) $tag[0] = $this->lessc->mPrefix; } return $tags; diff --git a/lessify.inc.php b/lessify.inc.php index c47301ad..08cbac47 100644 --- a/lessify.inc.php +++ b/lessify.inc.php @@ -56,7 +56,7 @@ public function literal($what, $eatWhitespace = true) { // shortcut on single letter if (!$eatWhitespace and strlen($what) === 1) { - if ($this->buffer{$this->count} == $what) { + if ($this->buffer[$this->count] == $what) { $this->count++; return true; }