ソースを参照

Revert change in $time_now

Joanhey 6 年 前
コミット
facf8ba008
1 ファイル変更6 行追加5 行削除
  1. 6 5
      Protocols/Http.php

+ 6 - 5
Protocols/Http.php

@@ -248,10 +248,10 @@ class Http
         // other headers
         $header .= \implode("\r\n", HttpCache::$header) . "\r\n";
 
-		    if(HttpCache::$gzip && isset($connection->gzip) && $connection->gzip){
-			      $header .= "Content-Encoding: gzip\r\n";
-			      $content = \gzencode($content,$connection->gzip);
-		    }
+        if(HttpCache::$gzip && isset($connection->gzip) && $connection->gzip){
+                $header .= "Content-Encoding: gzip\r\n";
+                $content = \gzencode($content,$connection->gzip);
+        }
         // header
         $header .= 'Content-Length: ' . \strlen($content) . "\r\n\r\n";
 
@@ -608,8 +608,9 @@ class Http
             return;
         }
 
+        $time_now = \time();
         foreach(glob(HttpCache::$sessionPath.'/ses*') as $file) {
-            if(\is_file($file) && \time() - \filemtime($file) > HttpCache::$sessionGcMaxLifeTime) {
+            if(\is_file($file) && $time_now - \filemtime($file) > HttpCache::$sessionGcMaxLifeTime) {
                 \unlink($file);
             }
         }