Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1102767
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
Tue, Aug 19, 7:45 AM
Size
1 KB
Mime Type
text/x-diff
Expires
Wed, Aug 20, 7:45 AM (8 h, 5 m)
Engine
blob
Format
Raw Data
Handle
714222
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