wp/wp-admin/includes/class-pclzip.php
changeset 7 cf61fcea0001
parent 0 d970ebf37754
child 16 a86126ab1dd4
--- a/wp/wp-admin/includes/class-pclzip.php	Tue Jun 09 11:14:17 2015 +0000
+++ b/wp/wp-admin/includes/class-pclzip.php	Mon Oct 14 17:39:30 2019 +0200
@@ -212,7 +212,7 @@
   //   Note that no real action is taken, if the archive does not exist it is not
   //   created. Use create() for that.
   // --------------------------------------------------------------------------------
-  function PclZip($p_zipname)
+  function __construct($p_zipname)
   {
 
     // ----- Tests the zlib
@@ -229,6 +229,10 @@
     // ----- Return
     return;
   }
+
+  public function PclZip($p_zipname) {
+    self::__construct($p_zipname);
+  }
   // --------------------------------------------------------------------------------
 
   // --------------------------------------------------------------------------------
@@ -1835,18 +1839,19 @@
     // ----- Get 'memory_limit' configuration value
     $v_memory_limit = ini_get('memory_limit');
     $v_memory_limit = trim($v_memory_limit);
+    $v_memory_limit_int = (int) $v_memory_limit;
     $last = strtolower(substr($v_memory_limit, -1));
 
     if($last == 'g')
-        //$v_memory_limit = $v_memory_limit*1024*1024*1024;
-        $v_memory_limit = $v_memory_limit*1073741824;
+        //$v_memory_limit_int = $v_memory_limit_int*1024*1024*1024;
+        $v_memory_limit_int = $v_memory_limit_int*1073741824;
     if($last == 'm')
-        //$v_memory_limit = $v_memory_limit*1024*1024;
-        $v_memory_limit = $v_memory_limit*1048576;
+        //$v_memory_limit_int = $v_memory_limit_int*1024*1024;
+        $v_memory_limit_int = $v_memory_limit_int*1048576;
     if($last == 'k')
-        $v_memory_limit = $v_memory_limit*1024;
-
-    $p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] = floor($v_memory_limit*PCLZIP_TEMPORARY_FILE_RATIO);
+        $v_memory_limit_int = $v_memory_limit_int*1024;
+
+    $p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] = floor($v_memory_limit_int*PCLZIP_TEMPORARY_FILE_RATIO);
 
 
     // ----- Sanity check : No threshold if value lower than 1M