Created
April 24, 2010 02:41
-
-
Save jakobo/377405 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/chippino/apps/chippino/template/chip/node/header.php b/lib/chippino/apps/chippino/template/chip/node/header.php | |
index d51b5ae..aeff84a 100644 | |
--- a/lib/chippino/apps/chippino/template/chip/node/header.php | |
+++ b/lib/chippino/apps/chippino/template/chip/node/header.php | |
@@ -9,7 +9,9 @@ class ChipHeader_PXHTMLNode extends PXHTMLNode { | |
$replace = (strtolower($node->getAttribute('replace')) == "false") ? FALSE : TRUE; | |
while ($node->firstChild) { | |
if ($node->firstChild->nodeType == XML_TEXT_NODE) { | |
- header(trim($node->firstChild->wholeText)."\n\n", $replace); | |
+ $str = 'header(trim("'.$node->firstChild->wholeText.'")."\n\n", '.$replace.');'; | |
+ $php_inst_st = $this->createProcessingInstruction($str); | |
+ $node->parentNode->insertBefore($php_inst_st, $node); | |
} | |
$node->removeChild($node->firstChild); | |
} | |
diff --git a/lib/chippino/apps/chippino/template/init.php b/lib/chippino/apps/chippino/template/init.php | |
index e79ee65..fa797d3 100644 | |
--- a/lib/chippino/apps/chippino/template/init.php | |
+++ b/lib/chippino/apps/chippino/template/init.php | |
@@ -29,6 +29,8 @@ $_chip_pxhtml_cache_file = chip($cache.'/'.$chk)->getFilePath().'.php'; | |
define('PXHTML_SIGNATURE_HASH', $chk); | |
+header('X-Chippino-File-Checksum: '.PXHTML_SIGNATURE_HASH."\n\n"); | |
+ | |
// begin output buffering | |
// check for zlib.output_compression | |
// open proper output bufer | |
@@ -40,7 +42,8 @@ else { | |
} | |
if (file_exists($_chip_pxhtml_cache_file)) { | |
- return include $_chip_pxhtml_cache_file; | |
+ include $_chip_pxhtml_cache_file; | |
+ return ''; | |
} | |
$content = PXHTML::parse($file, null); | |
@@ -55,3 +58,4 @@ unset($chk); | |
include $_chip_pxhtml_cache_file; | |
// $output = trim(ob_get_contents()); | |
ob_end_flush(); | |
+return ''; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment