From b19d75a2644edad6d63cfe58b99d0495cbc2afd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0koda?= Date: Mon, 23 Dec 2013 09:50:04 +0800 Subject: [PATCH] MDL-43402 let's try to remove @ silencing from gzip related code If anything goes wrong on multiple production sites we can just revert this commit, that is why it is separete from the rest of zlib stuff. --- lib/configonlylib.php | 8 ++++---- lib/filelib.php | 2 +- lib/setup.php | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/configonlylib.php b/lib/configonlylib.php index 8192704259d..36af200b59b 100644 --- a/lib/configonlylib.php +++ b/lib/configonlylib.php @@ -142,14 +142,14 @@ function min_enable_zlib_compression() { // zlib.output_compression is preferred over ob_gzhandler() if (!empty($_SERVER['HTTP_USER_AGENT']) and strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6') !== false) { - @ini_set('zlib.output_compression', 'Off'); + ini_set('zlib.output_compression', 'Off'); if (function_exists('apache_setenv')) { - @apache_setenv('no-gzip', 1); + apache_setenv('no-gzip', 1); } return false; } - @ini_set('output_handler', ''); + ini_set('output_handler', ''); /* * docs clearly say 'on' means enable and number means size of buffer, @@ -157,7 +157,7 @@ function min_enable_zlib_compression() { * 1 probably sets chunk size to 4096. our CSS and JS scripts are much bigger, * so let's try some bigger sizes. */ - @ini_set('zlib.output_compression', 65536); + ini_set('zlib.output_compression', 65536); return true; } diff --git a/lib/filelib.php b/lib/filelib.php index ebdd06c8d2b..bae53e0bb01 100644 --- a/lib/filelib.php +++ b/lib/filelib.php @@ -2672,7 +2672,7 @@ function fulldelete($location) { */ function byteserving_send_file($handle, $mimetype, $ranges, $filesize) { // better turn off any kind of compression and buffering - @ini_set('zlib.output_compression', 'Off'); + ini_set('zlib.output_compression', 'Off'); $chunksize = 1*(1024*1024); // 1MB chunks - must be less than 2MB! if ($handle === false) { diff --git a/lib/setup.php b/lib/setup.php index f1d3054e4fd..803782803f8 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -985,9 +985,9 @@ if (PHPUNIT_TEST) { // // try to detect IE6 and prevent gzip because it is extremely buggy browser if (!empty($_SERVER['HTTP_USER_AGENT']) and strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6') !== false) { - @ini_set('zlib.output_compression', 'Off'); + ini_set('zlib.output_compression', 'Off'); if (function_exists('apache_setenv')) { - @apache_setenv('no-gzip', 1); + apache_setenv('no-gzip', 1); } }