Skip to content

Commit ce644ca

Browse files
committed
Fixes leafo#588 - invalid CSS outside of selector
1 parent 2f88bb8 commit ce644ca

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Parser.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,6 @@ public function parse($buffer)
200200
array_unshift($this->env->children, $this->charset);
201201
}
202202

203-
$this->env->isRoot = true;
204-
205203
$this->restoreEncoding();
206204

207205
if ($this->cache) {
@@ -675,6 +673,10 @@ protected function parseChunk()
675673
$foundSomething = false;
676674

677675
if ($this->valueList($value)) {
676+
if (empty($this->env->parent)) {
677+
$this->throwParseError('expected "{"');
678+
}
679+
678680
$this->append([Type::T_ASSIGN, $name, $value], $s);
679681
$foundSomething = true;
680682
}

0 commit comments

Comments
 (0)