diff --git a/lessc.inc.php b/lessc.inc.php index 5c81ad2a..75bcdd4d 100644 --- a/lessc.inc.php +++ b/lessc.inc.php @@ -42,6 +42,7 @@ class lessc { static protected $TRUE = array("keyword", "true"); static protected $FALSE = array("keyword", "false"); + protected $allParsedFiles = array(); protected $libFunctions = array(); protected $registeredVars = array(); protected $preserveComments = false; @@ -108,6 +109,11 @@ protected function tryImport($importPath, $parentBlock, $out) { if ($this->importDisabled) { return array(false, "/* import disabled */"); } + + // import once + if(array_key_exists(realpath($realPath), $this->allParsedFiles())) { + return array(false, ''); + } $this->addParsedFile($realPath); $parser = $this->makeParser($realPath);