From cc883c5bf132b63cfa7d930d43a877ae13a186fe Mon Sep 17 00:00:00 2001 From: Brian Scaturro Date: Mon, 18 May 2015 16:09:21 -0400 Subject: [PATCH 1/2] object check --- src/Compiler.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Compiler.php b/src/Compiler.php index 0efdd37b..787906c4 100644 --- a/src/Compiler.php +++ b/src/Compiler.php @@ -943,9 +943,9 @@ protected function compileChild($child, $out) case 'mixin_content': $content = $this->get(self::$namespaces['special'] . 'content'); - if (!isset($content)) { - $this->throwError('Expected @content inside of mixin'); - } + if (!is_object($content)) { + return; + } $strongTypes = array('include', 'block', 'for', 'while'); From c55c28d2cdfc19321ec2cbfa30e8a69f47ebaf0f Mon Sep 17 00:00:00 2001 From: Brian Scaturro Date: Wed, 14 Dec 2016 10:33:03 -0500 Subject: [PATCH 2/2] Coerce number values before doing math --- src/Compiler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compiler.php b/src/Compiler.php index 787906c4..30ece138 100644 --- a/src/Compiler.php +++ b/src/Compiler.php @@ -1244,7 +1244,7 @@ protected function normalizeNumber($number) if (isset(self::$unitTable['in'][$unit])) { $conv = self::$unitTable['in'][$unit]; - return array('number', $value / $conv, 'in'); + return array('number', (float) $value / (float) $conv, 'in'); } return $number;