diff --git a/framework/core/src/Asset/LessCompiler.php b/framework/core/src/Asset/LessCompiler.php index 52546106b..ae619504a 100644 --- a/framework/core/src/Asset/LessCompiler.php +++ b/framework/core/src/Asset/LessCompiler.php @@ -38,6 +38,10 @@ class LessCompiler extends RevisionCompiler */ public function compile() { + if (! count($this->files) || ! count($this->strings)) { + return; + } + ini_set('xdebug.max_nesting_level', 200); $parser = new Less_Parser([ diff --git a/framework/core/src/Asset/RevisionCompiler.php b/framework/core/src/Asset/RevisionCompiler.php index 50f19b806..6873ccb3c 100644 --- a/framework/core/src/Asset/RevisionCompiler.php +++ b/framework/core/src/Asset/RevisionCompiler.php @@ -92,10 +92,10 @@ class RevisionCompiler implements CompilerInterface $file = $this->path.'/'.substr_replace($this->filename, '-'.$current, -strlen($ext) - 1, 0); - if ($this->files || $this->strings) { + if ($content = $this->compile()) { $this->putRevision($current); - file_put_contents($file, $this->compile()); + file_put_contents($file, $content); } else { return; }