summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/core/Output.php15
-rw-r--r--system/helpers/file_helper.php2
-rw-r--r--user_guide/changelog.html2
3 files changed, 17 insertions, 2 deletions
diff --git a/system/core/Output.php b/system/core/Output.php
index ac4129405..e25e62197 100644
--- a/system/core/Output.php
+++ b/system/core/Output.php
@@ -34,10 +34,13 @@ class CI_Output {
var $enable_profiler = FALSE;
var $parse_exec_vars = TRUE; // whether or not to parse variables like {elapsed_time} and {memory_usage}
+ var $_zlib_oc = FALSE;
var $_profiler_sections = array();
function CI_Output()
{
+ $this->_zlib_oc = @ini_get('zlib.output_compression');
+
log_message('debug', "Output Class Initialized");
}
@@ -111,6 +114,16 @@ class CI_Output {
*/
function set_header($header, $replace = TRUE)
{
+ // If zlib.output_compression is enabled it will compress the output,
+ // but it will not modify the content-length header to compensate for
+ // the reduction, causing the browser to hang waiting for more data.
+ // We'll just skip content-length in those cases.
+
+ if ($this->_zlib_oc && strncasecmp($header, 'content-length', 14) == 0)
+ {
+ return;
+ }
+
$this->headers[] = array($header, $replace);
}
@@ -234,7 +247,7 @@ class CI_Output {
// --------------------------------------------------------------------
// Is compression requested?
- if ($CFG->item('compress_output') === TRUE)
+ if ($CFG->item('compress_output') === TRUE && $this->_zlib_oc == FALSE)
{
if (extension_loaded('zlib'))
{
diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php
index 274c4ad37..448bf275f 100644
--- a/system/helpers/file_helper.php
+++ b/system/helpers/file_helper.php
@@ -305,7 +305,7 @@ if ( ! function_exists('get_file_info'))
$fileinfo['size'] = filesize($file);
break;
case 'date':
- $fileinfo['date'] = filectime($file);
+ $fileinfo['date'] = filemtime($file);
break;
case 'readable':
$fileinfo['readable'] = is_readable($file);
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index cfb7396c6..02cf6d06f 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -118,6 +118,7 @@ Hg Tag: </p>
<li>Added an optional second parameter to <kbd>byte_format()</kbd> in the <a href="helpers/number_helper.html">Number Helper</a> to allow for decimal precision.</li>
<li>Added alpha, and sha1 string types to <kbd>random_string()</kbd> in the <a href="helpers/string_helper.html">String Helper</a>.</li>
<li>Modified <kbd>prep_url()</kbd> so as to not prepend http:// if the supplied string already has a scheme.</li>
+ <li>Modified <kbd>get_file_info</kbd> in the file helper, changing filectime() to filemtime() for dates.</li>
</ul>
</li>
<li>Other Changes
@@ -128,6 +129,7 @@ Hg Tag: </p>
<li><kbd>get_mime_by_extension()</kbd> is now case insensitive.</li>
<li>Added "default" to the list <a href="general/reserved_names.html">Reserved Names</a>.</li>
<li>Added 'application/x-msdownload' for .exe files and ''application/x-gzip-compressed' for .tgz files to config/mimes.php.</li>
+ <li>Updated the output library to no longer compress output or send content-length headers if the server runs with zlib.output_compression enabled.</li>
<li>Eliminated a call to is_really_writable() on each request unless it is really needed (Output caching)</li>
<li>Documented <kbd>append_output()</kbd> in the <a href="libraries/output.html">Output Class</a>.</li>
<li>Documented a second argument in the <kbd>decode()</kbd> function for the <a href="libraries/encryption.html">Encryption Class</a>.</li>