Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F785556
D106.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Feb 12, 2:56 PM
Size
1 KB
Mime Type
text/x-diff
Expires
Thu, Feb 13, 2:56 PM (5 h, 6 m)
Engine
blob
Format
Raw Data
Handle
564531
Attached To
D106: INP-1457 - Clear template parser state before parsing "404 Not Found" template
D106.diff
View Options
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']);
Event Timeline
Log In to Comment