Fixed bug #9790: class.gzip_encode.php fails with open_basedir restrictions
authorDmitry Dulepov <dmitry.dulepov@gmail.com>
Mon, 1 Dec 2008 16:21:36 +0000 (16:21 +0000)
committerDmitry Dulepov <dmitry.dulepov@gmail.com>
Mon, 1 Dec 2008 16:21:36 +0000 (16:21 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@4514 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.gzip_encode.php

index ad0f528..ca660a4 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2008-12-01  Dmitry Dulepov  <dmitry@typo3.org>
 
        * Fixed bug #9645: Memcached backend is not working properly
+       * Fixed bug #9790: class.gzip_encode.php fails with     open_basedir restrictions
 
 2008-12-01  Steffen Kamper  <info@sk-typo3.de>
 
@@ -32,7 +33,7 @@
 
 2008-11-25  Steffen Kamper  <info@sk-typo3.de>
 
-       * Fixed bug #8561 Checkboxes and labels are aligned badly if in one line
+       * Fixed bug #8561: Checkboxes and labels are aligned badly if in one line
 
 2008-11-24  Dmitry Dulepov  <dmitry@typo3.org>
 
index 4e1b3c2..52b1b5d 100755 (executable)
@@ -339,13 +339,15 @@ class gzip_encode {
         * @return      float           Returns the current load average
         */
        function linux_loadavg() {
-               $buffer = "0 0 0";
-               $f = fopen("/proc/loadavg","rb");
-               if (!feof($f)) {
-                   $buffer = fgets($f, 1024);
+               $buffer = '0 0 0';
+               $f = @fopen('/proc/loadavg', 'rb');
+               if ($f) {
+                       if (!feof($f)) {
+                               $buffer = fgets($f, 1024);
+                       }
+                       fclose($f);
                }
-               fclose($f);
-               $load = explode(" ",$buffer);
+               $load = explode(' ', $buffer);
                return max((float)$load[0], (float)$load[1], (float)$load[2]);
        }