Index: branches/5.2.x/core/kernel/application.php =================================================================== --- branches/5.2.x/core/kernel/application.php +++ branches/5.2.x/core/kernel/application.php @@ -1085,11 +1085,10 @@ */ public function QuickRun() { - // discard any half-parsed content - ob_clean(); - - // replace current page content with 404 + // Replace current page content with 404. $this->InitParser(); + + $this->Parser->Clear(); $this->HTML = $this->Parser->Run($this->GetVar('t')); } Index: branches/5.2.x/core/kernel/nparser/nparser.php =================================================================== --- branches/5.2.x/core/kernel/nparser/nparser.php +++ branches/5.2.x/core/kernel/nparser/nparser.php @@ -140,6 +140,46 @@ $this->CachingEnabled = !$this->Application->isAdmin && $this->Application->ConfigValue('SystemTagCache') && $this->Application->isCachingType(CACHING_TYPE_MEMORY); } + function Clear() + { + // Discard any half-parsed content. + ob_clean(); + + $this->Stack = array(); + $this->Level = 0; + + $this->Buffers = array(); + $this->InsideComment = false; + + $this->SkipComments = true; + + $this->Params = array(); + $this->ParamsStack = array(); + $this->ParamsLevel = 0; + + $this->Definitions = ''; + + $this->Elements = array(); + + $this->ElementLocations = array(); + + $this->DataExists = false; + + $this->TemplateName = null; + $this->TempalteFullPath = null; + + $this->CachePointers = array(); + $this->Cachable = array(); + + $this->CacheLevel = 0; + + $this->FullCachePage = false; + + $this->PrefixesInUse = array(); + + $this->Captures = array(); + } + function Compile($pre_parsed, $template_name = 'unknown') { $data = file_get_contents($pre_parsed['tname']);