mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-11 00:14:50 +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;
|
||||
}
|
||||
|
||||
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) {
|
||||
$locale = setlocale(LC_NUMERIC, 0);
|
||||
setlocale(LC_NUMERIC, "C");
|
||||
|
|
@ -1558,25 +1583,7 @@ class lessc {
|
|||
$this->sourceParser = $this->parser; // used for error messages
|
||||
$this->compileBlock($root);
|
||||
|
||||
$out = '';
|
||||
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 .= '}';
|
||||
}
|
||||
}
|
||||
|
||||
$out = $this->block($this->scope);
|
||||
setlocale(LC_NUMERIC, $locale);
|
||||
return $out;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue