mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Fix broken lessphp
This commit is contained in:
parent
d33ec54c1c
commit
a28d8f4e04
1 changed files with 26 additions and 19 deletions
|
|
@ -1545,6 +1545,31 @@ class lessc {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function block($block) : string {
|
||||||
|
if ($this->isEmpty($block))
|
||||||
|
return '';
|
||||||
|
|
||||||
|
$result = '';
|
||||||
|
|
||||||
|
if (!empty($block->selectors)) {
|
||||||
|
$result .= implode(',', $block->selectors) . '{';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($block->lines)) {
|
||||||
|
$result .= implode('', $block->lines);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($block->children as $child) {
|
||||||
|
$result .= $this->block($child);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($block->selectors)) {
|
||||||
|
$result .= '}';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
public function compile($string, $name = null) {
|
public function compile($string, $name = null) {
|
||||||
$locale = setlocale(LC_NUMERIC, 0);
|
$locale = setlocale(LC_NUMERIC, 0);
|
||||||
setlocale(LC_NUMERIC, "C");
|
setlocale(LC_NUMERIC, "C");
|
||||||
|
|
@ -1558,25 +1583,7 @@ class lessc {
|
||||||
$this->sourceParser = $this->parser; // used for error messages
|
$this->sourceParser = $this->parser; // used for error messages
|
||||||
$this->compileBlock($root);
|
$this->compileBlock($root);
|
||||||
|
|
||||||
$out = '';
|
$out = $this->block($this->scope);
|
||||||
if (!$this->isEmpty($this->scope)) {
|
|
||||||
if (!empty($this->scope->selectors)) {
|
|
||||||
$out .= implode(',', $this->scope->selectors) . '{';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($this->scope->lines)) {
|
|
||||||
$out .= implode('', $this->scope->lines);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($this->scope->children as $child) {
|
|
||||||
$out .= $this->block($child);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($this->scope->selectors)) {
|
|
||||||
$out .= '}';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
setlocale(LC_NUMERIC, $locale);
|
setlocale(LC_NUMERIC, $locale);
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue