Ticket #60415: 60415.5.patch
File 60415.5.patch, 4.6 KB (added by , 9 months ago) |
---|
-
wp-admin/includes/class-pclzip.php
376 376 // ----- Reformat the string list 377 377 if (sizeof($v_string_list) != 0) { 378 378 foreach ($v_string_list as $v_string) { 379 if ($v_string != '') {379 if ($v_string !== '') { 380 380 $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string; 381 381 } 382 382 else { … … 772 772 } 773 773 if (isset($v_options[PCLZIP_OPT_ADD_PATH])) { 774 774 // ----- Check for '/' in last path char 775 if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) {775 if ((strlen($v_path) > 0) && (substr($v_path, -1) !== '/')) { 776 776 $v_path .= '/'; 777 777 } 778 778 $v_path .= $v_options[PCLZIP_OPT_ADD_PATH]; … … 928 928 } 929 929 if (isset($v_options[PCLZIP_OPT_ADD_PATH])) { 930 930 // ----- Check for '/' in last path char 931 if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) {931 if ((strlen($v_path) > 0) && (substr($v_path, -1) !== '/')) { 932 932 $v_path .= '/'; 933 933 } 934 934 $v_path .= $v_options[PCLZIP_OPT_ADD_PATH]; … … 1526 1526 1527 1527 // ----- Get the value 1528 1528 if ( is_string($p_options_list[$i+1]) 1529 && ($p_options_list[$i+1] != '')) {1529 && ($p_options_list[$i+1] !== '')) { 1530 1530 $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], FALSE); 1531 1531 $i++; 1532 1532 } … … 2077 2077 // files/sub-folders also change 2078 2078 if (($v_descr['stored_filename'] != $v_descr['filename']) 2079 2079 && (!isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH]))) { 2080 if ($v_descr['stored_filename'] != '') {2080 if ($v_descr['stored_filename'] !== '') { 2081 2081 $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_descr['stored_filename'].'/'.$v_item_handler; 2082 2082 } 2083 2083 else { … … 2487 2487 } 2488 2488 2489 2489 // ----- Check the filename 2490 if ( ($p_filedescr_list[$j]['type'] != 'virtual_file')2490 if ( ($p_filedescr_list[$j]['type'] !== 'virtual_file') 2491 2491 && (!file_exists($p_filedescr_list[$j]['filename']))) { 2492 2492 PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "File '".$p_filedescr_list[$j]['filename']."' does not exist"); 2493 2493 return PclZip::errorCode(); … … 2755 2755 // ----- Look for a directory 2756 2756 else if ($p_filedescr['type'] == 'folder') { 2757 2757 // ----- Look for directory last '/' 2758 if (@substr($p_header['stored_filename'], -1) != '/') {2758 if (@substr($p_header['stored_filename'], -1) !== '/') { 2759 2759 $p_header['stored_filename'] .= '/'; 2760 2760 } 2761 2761 … … 2955 2955 if (isset($p_filedescr['new_short_name'])) { 2956 2956 $v_path_info = pathinfo($p_filename); 2957 2957 $v_dir = ''; 2958 if ($v_path_info['dirname'] != '') {2958 if ($v_path_info['dirname'] !== '') { 2959 2959 $v_dir = $v_path_info['dirname'].'/'; 2960 2960 } 2961 2961 $v_stored_filename = $v_dir.$p_filedescr['new_short_name']; … … 2971 2971 } 2972 2972 // ----- Look for partial path remove 2973 2973 else if ($p_remove_dir != "") { 2974 if (substr($p_remove_dir, -1) != '/')2974 if (substr($p_remove_dir, -1) !== '/') 2975 2975 $p_remove_dir .= "/"; 2976 2976 2977 2977 if ( (substr($p_filename, 0, 2) == "./") … … 3305 3305 } 3306 3306 3307 3307 // ----- Look for path to remove format (should end by /) 3308 if (($p_remove_path != "") && (substr($p_remove_path, -1) != '/'))3308 if (($p_remove_path != "") && (substr($p_remove_path, -1) !== '/')) 3309 3309 { 3310 3310 $p_remove_path .= '/'; 3311 3311 } … … 3482 3482 } 3483 3483 3484 3484 // ----- Look for real extraction 3485 if (($v_extract) && ($v_header['status'] != 'ok')) {3485 if (($v_extract) && ($v_header['status'] !== 'ok')) { 3486 3486 $v_result = $this->privConvertHeader2FileInfo($v_header, 3487 3487 $p_file_list[$v_nb_extracted++]); 3488 3488 if ($v_result != 1) { … … 3675 3675 } 3676 3676 3677 3677 // ----- Add the path 3678 if ($p_path != '') {3678 if ($p_path !== '') { 3679 3679 $p_entry['filename'] = $p_path."/".$p_entry['filename']; 3680 3680 } 3681 3681 … … 5548 5548 } 5549 5549 5550 5550 // ----- Compare the items 5551 if (($v_list_dir[$i] != $v_list_path[$j]) && ($v_list_dir[$i] != '') && ( $v_list_path[$j] != '')) {5551 if (($v_list_dir[$i] != $v_list_path[$j]) && ($v_list_dir[$i] !== '') && ( $v_list_path[$j] !== '')) { 5552 5552 $v_result = 0; 5553 5553 } 5554 5554