diff options
author | Jonatas Miguel <jonatas.df.miguel@gmail.com> | 2012-10-24 19:30:36 +0200 |
---|---|---|
committer | Jonatas Miguel <jonatas.df.miguel@gmail.com> | 2012-10-24 19:30:36 +0200 |
commit | b51823dde5fbae508b8ebf99258d2f514a8bece8 (patch) | |
tree | 4db09a22f85e0ddf151c940cd3e6fbaa799b8513 /system/core/Output.php | |
parent | a53f402b78ad07fb0f6da19cff0c7bec3a09a4c0 (diff) | |
parent | a7001e968a4791312391eb245ad84888893cda8f (diff) |
Merge branch 'develop' of git://github.com/EllisLab/CodeIgniter into develop
Conflicts:
user_guide_src/source/changelog.rst
Diffstat (limited to 'system/core/Output.php')
-rw-r--r-- | system/core/Output.php | 9 |
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; } |