summaryrefslogtreecommitdiffstats
path: root/system/core/Output.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/core/Output.php')
-rw-r--r--system/core/Output.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/system/core/Output.php b/system/core/Output.php
index 5ec8c4bc0..aa0e05dc4 100644
--- a/system/core/Output.php
+++ b/system/core/Output.php
@@ -204,7 +204,8 @@ class CI_Output {
/**
* Set Content Type Header
*
- * @param string extension of the file we're outputting
+ * @param string $mime_type extension of the file we're outputting
+ * @param string $charset = NULL
* @return void
*/
public function set_content_type($mime_type, $charset = NULL)
@@ -552,13 +553,13 @@ class CI_Output {
fclose($fp);
// Strip out the embedded timestamp
- if ( ! preg_match('/(\d+TS--->)/', $cache, $match))
+ if ( ! preg_match('/^(\d+)TS--->/', $cache, $match))
{
return FALSE;
}
$last_modified = filemtime($cache_path);
- $expire = trim(str_replace('TS--->', '', $match[1]));
+ $expire = $match[1];
// Has the file expired?
if ($_SERVER['REQUEST_TIME'] >= $expire && is_really_writable($cache_path))
@@ -575,7 +576,7 @@ class CI_Output {
}
// Display the cache
- $this->_display(str_replace($match[0], '', $cache));
+ $this->_display(substr($cache, strlen($match[0])));
log_message('debug', 'Cache file is current. Sending it to browser.');
return TRUE;
}