From f645178391426ce859aad0bebf461516e1165123 Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Tue, 19 Jul 2016 11:55:30 +0000 Subject: [PATCH] Filesystem API: Ensure memory limit calculations by PclZip are using integers. This prevents a warning in PHP trunk, see https://wiki.php.net/rfc/invalid_strings_in_arithmetic. See #36435. Built from https://develop.svn.wordpress.org/trunk@38101 git-svn-id: http://core.svn.wordpress.org/trunk@38042 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-pclzip.php | 13 +++++++------ wp-includes/version.php | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/wp-admin/includes/class-pclzip.php b/wp-admin/includes/class-pclzip.php index f36a4a3eef..ae0af7a8f1 100644 --- a/wp-admin/includes/class-pclzip.php +++ b/wp-admin/includes/class-pclzip.php @@ -1839,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; + $v_memory_limit_int = $v_memory_limit_int*1024; - $p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] = floor($v_memory_limit*PCLZIP_TEMPORARY_FILE_RATIO); + $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 diff --git a/wp-includes/version.php b/wp-includes/version.php index 37dbed060e..ca85aae58a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6-beta3-38100'; +$wp_version = '4.6-beta3-38101'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.