Changeset 11930
- Timestamp:
- 09/14/2009 02:03:32 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 44 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/comment.php
r11793 r11930 47 47 if ( 'trash' == $comment->comment_approved ) 48 48 comment_footer_die( __('This comment is in the Trash. Please move it out of the Trash if you want to edit it.') ); 49 49 50 50 $comment = get_comment_to_edit( $comment_id ); 51 51 … … 171 171 $comment_id = absint( $_REQUEST['c'] ); 172 172 $noredir = isset($_REQUEST['noredir']); 173 173 174 174 if (!$comment = get_comment($comment_id)) 175 175 comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit-comments.php') ); 176 176 if (!current_user_can('edit_post', $comment->comment_post_ID )) 177 177 comment_footer_die( __('You are not allowed to edit comments on this post.') ); 178 178 179 179 if ($action == 'trashcomment') { 180 180 check_admin_referer( 'trash-comment_' . $comment_id ); … … 185 185 wp_untrash_comment($comment_id); 186 186 } 187 187 188 188 if ('' != wp_get_referer() && false == $noredir && false === strpos(wp_get_referer(), 'comment.php' )) 189 189 wp_redirect( wp_get_referer() ); -
trunk/wp-admin/edit-comments.php
r11841 r11930 20 20 if ( isset($_REQUEST['doaction']) || isset($_REQUEST['doaction2']) || isset($_REQUEST['delete_all']) || isset($_REQUEST['delete_all2']) ) { 21 21 check_admin_referer('bulk-comments'); 22 22 23 23 if ((isset($_REQUEST['delete_all']) || isset($_REQUEST['delete_all2'])) && !empty($_REQUEST['pagegen_timestamp'])) { 24 24 $comment_status = $wpdb->escape($_REQUEST['comment_status']); … … 30 30 $doaction = ($_REQUEST['action'] != -1) ? $_REQUEST['action'] : $_REQUEST['action2']; 31 31 } else wp_redirect($_SERVER['HTTP_REFERER']); 32 32 33 33 $approved = $unapproved = $spammed = $trashed = $untrashed = $deleted = 0; 34 34 35 35 foreach ($comment_ids as $comment_id) { // Check the permissions on each 36 36 $_post_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = %d", $comment_id) ); -
trunk/wp-admin/edit-pages.php
r11807 r11930 41 41 if ( !wp_trash_post($post_id) ) 42 42 wp_die( __('Error in moving to trash...') ); 43 43 44 44 $trashed++; 45 45 } … … 54 54 if ( !wp_untrash_post($post_id) ) 55 55 wp_die( __('Error in restoring from trash...') ); 56 56 57 57 $untrashed++; 58 58 } -
trunk/wp-admin/edit.php
r11843 r11930 49 49 if ( !wp_trash_post($post_id) ) 50 50 wp_die( __('Error in moving to trash...') ); 51 51 52 52 $trashed++; 53 53 } … … 62 62 if ( !wp_untrash_post($post_id) ) 63 63 wp_die( __('Error in restoring from trash...') ); 64 64 65 65 $untrashed++; 66 66 } -
trunk/wp-admin/includes/class-pclzip.php
r11056 r11930 30 30 define( 'PCLZIP_READ_BLOCK_SIZE', 2048 ); 31 31 } 32 32 33 33 // ----- File list separator 34 34 // In version 1.x of PclZip, the separator for file list is a space … … 69 69 // ----- Optional threshold ratio for use of temporary files 70 70 // Pclzip sense the size of the file to add/extract and decide to 71 // use or not temporary file. The algorythm is looking for 71 // use or not temporary file. The algorythm is looking for 72 72 // memory_limit of PHP and apply a ratio. 73 73 // threshold = memory_limit * ratio. … … 153 153 define( 'PCLZIP_OPT_TEMP_FILE_OFF', 77022 ); 154 154 define( 'PCLZIP_OPT_ADD_TEMP_FILE_OFF', 77022 ); // alias 155 155 156 156 // ----- File description attributes 157 157 define( 'PCLZIP_ATT_FILE_NAME', 79001 ); … … 199 199 var $error_code = 1; 200 200 var $error_string = ''; 201 201 202 202 // ----- Current status of the magic_quotes_runtime 203 203 // This value store the php configuration for magic_quotes … … 342 342 } 343 343 } 344 344 345 345 // ----- Look for default option values 346 346 $this->privOptionDefaultThreshold($v_options); … … 351 351 $v_filedescr_list = array(); 352 352 $p_result_list = array(); 353 353 354 354 // ----- Look if the $p_filelist is really an array 355 355 if (is_array($p_filelist)) { 356 356 357 357 // ----- Look if the first element is also an array 358 358 // This will mean that this is a file description entry … … 360 360 $v_att_list = $p_filelist; 361 361 } 362 362 363 363 // ----- The list is a list of string names 364 364 else { … … 379 379 return 0; 380 380 } 381 381 382 382 // ----- Reformat the string list 383 383 if (sizeof($v_string_list) != 0) { … … 391 391 } 392 392 } 393 393 394 394 // ----- For each file in the list check the attributes 395 395 $v_supported_attributes … … 550 550 $v_filedescr_list = array(); 551 551 $p_result_list = array(); 552 552 553 553 // ----- Look if the $p_filelist is really an array 554 554 if (is_array($p_filelist)) { 555 555 556 556 // ----- Look if the first element is also an array 557 557 // This will mean that this is a file description entry … … 559 559 $v_att_list = $p_filelist; 560 560 } 561 561 562 562 // ----- The list is a list of string names 563 563 else { … … 578 578 return 0; 579 579 } 580 580 581 581 // ----- Reformat the string list 582 582 if (sizeof($v_string_list) != 0) { … … 585 585 } 586 586 } 587 587 588 588 // ----- For each file in the list check the attributes 589 589 $v_supported_attributes … … 1050 1050 // PCLZIP_OPT_BY_INDEX : 1051 1051 // PCLZIP_OPT_BY_NAME : 1052 // PCLZIP_OPT_BY_EREG : 1052 // PCLZIP_OPT_BY_EREG : 1053 1053 // PCLZIP_OPT_BY_PREG : 1054 1054 // Return Values : … … 1125 1125 { 1126 1126 //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::deleteByIndex", "index='$p_index'"); 1127 1127 1128 1128 $p_list = $this->delete(PCLZIP_OPT_BY_INDEX, $p_index); 1129 1129 … … 1179 1179 { 1180 1180 $this->privSwapBackMagicQuotes(); 1181 1181 1182 1182 // ----- Error log 1183 1183 PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode'); … … 1508 1508 //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privParseOptions", ""); 1509 1509 $v_result=1; 1510 1510 1511 1511 // ----- Read the options 1512 1512 $i=0; … … 1553 1553 return PclZip::errorCode(); 1554 1554 } 1555 1555 1556 1556 // ----- Check for incompatible options 1557 1557 if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_OFF])) { … … 1560 1560 return PclZip::errorCode(); 1561 1561 } 1562 1562 1563 1563 // ----- Check the value 1564 1564 $v_value = $p_options_list[$i+1]; … … 1582 1582 return PclZip::errorCode(); 1583 1583 } 1584 1584 1585 1585 $v_result_list[$p_options_list[$i]] = true; 1586 1586 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); … … 1600 1600 return PclZip::errorCode(); 1601 1601 } 1602 1602 1603 1603 $v_result_list[$p_options_list[$i]] = true; 1604 1604 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); … … 1764 1764 return PclZip::errorCode(); 1765 1765 } 1766 1766 1767 1767 // ----- Reduce the index list 1768 1768 // each index item in the list must be a couple with a start and … … 1775 1775 $v_item_list = explode("-", $v_work_list[$j]); 1776 1776 $v_size_item_list = sizeof($v_item_list); 1777 1777 1778 1778 // ----- TBC : Here we might check that each item is a 1779 1779 // real integer ... 1780 1780 1781 1781 // ----- Look for single value 1782 1782 if ($v_size_item_list == 1) { … … 1816 1816 $v_sort_value = $v_result_list[$p_options_list[$i]][$j]['start']; 1817 1817 } 1818 1818 1819 1819 // ----- Sort the items 1820 1820 if ($v_sort_flag) { … … 1929 1929 } 1930 1930 } 1931 1931 1932 1932 // ----- Look for default values 1933 1933 if (!isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) { 1934 1934 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3,"Calculate auto threshold"); 1935 1935 1936 1936 } 1937 1937 … … 1952 1952 //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privOptionDefaultThreshold", ""); 1953 1953 $v_result=1; 1954 1954 1955 1955 if (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]) 1956 1956 || isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) { … … 1958 1958 return $v_result; 1959 1959 } 1960 1960 1961 1961 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3,"Create an auto-threshold for use of temporay files"); 1962 1962 // ----- Get 'memory_limit' configuration value … … 1964 1964 $v_memory_limit = trim($v_memory_limit); 1965 1965 $last = strtolower(substr($v_memory_limit, -1)); 1966 1966 1967 1967 if($last == 'g') 1968 1968 //$v_memory_limit = $v_memory_limit*1024*1024*1024; … … 1973 1973 if($last == 'k') 1974 1974 $v_memory_limit = $v_memory_limit*1024; 1975 1975 1976 1976 $p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] = floor($v_memory_limit*PCLZIP_TEMPORARY_FILE_RATIO); 1977 1977 1978 1978 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3,"Current memory usage : ".memory_get_usage(TRUE)." bytes"); 1979 1979 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3,"Threshold value is : ".$p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]." bytes"); … … 1984 1984 unset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]); 1985 1985 } 1986 1986 1987 1987 // ----- Return 1988 1988 //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); … … 2003 2003 //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privFileDescrParseAtt", ""); 2004 2004 $v_result=1; 2005 2005 2006 2006 // ----- For each file in the list check the attributes 2007 2007 foreach ($p_file_list as $v_key => $v_value) { 2008 2008 2009 2009 // ----- Check if the option is supported 2010 2010 if (!isset($v_requested_options[$v_key])) { … … 2028 2028 $p_filedescr['filename'] = PclZipUtilPathReduction($v_value); 2029 2029 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($v_key)." = '".$v_value."'"); 2030 2030 2031 2031 if ($p_filedescr['filename'] == '') { 2032 2032 PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty filename for attribute '".PclZipUtilOptionText($v_key)."'"); … … 2124 2124 } 2125 2125 } 2126 2126 2127 2127 // end foreach 2128 2128 } 2129 2129 2130 2130 // ----- Return 2131 2131 //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); … … 2141 2141 // just ignore the item. 2142 2142 // Then prepare the information that will be stored for that file. 2143 // When its a folder, expand the folder with all the files that are in that 2143 // When its a folder, expand the folder with all the files that are in that 2144 2144 // folder (recursively). 2145 2145 // Parameters : … … 2152 2152 //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privFileDescrExpand", ""); 2153 2153 $v_result=1; 2154 2154 2155 2155 // ----- Create a result list 2156 2156 $v_result_list = array(); 2157 2157 2158 2158 // ----- Look each entry 2159 2159 for ($i=0; $i<sizeof($p_filedescr_list); $i++) { 2160 2160 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Looking for file ".$i."."); 2161 2161 2162 2162 // ----- Get filedescr 2163 2163 $v_descr = $p_filedescr_list[$i]; 2164 2164 2165 2165 // ----- Reduce the filename 2166 2166 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filedescr before reduction :'".$v_descr['filename']."'"); … … 2168 2168 $v_descr['filename'] = PclZipUtilPathReduction($v_descr['filename']); 2169 2169 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filedescr after reduction :'".$v_descr['filename']."'"); 2170 2170 2171 2171 // ----- Look for real file or folder 2172 2172 if (file_exists($v_descr['filename'])) { … … 2190 2190 } 2191 2191 } 2192 2192 2193 2193 // ----- Look for string added as file 2194 2194 else if (isset($v_descr['content'])) { … … 2196 2196 $v_descr['type'] = 'virtual_file'; 2197 2197 } 2198 2198 2199 2199 // ----- Missing file 2200 2200 else { … … 2207 2207 return PclZip::errorCode(); 2208 2208 } 2209 2209 2210 2210 // ----- Calculate the stored filename 2211 2211 $this->privCalculateStoredFilename($v_descr, $p_options); 2212 2212 2213 2213 // ----- Add the descriptor in result list 2214 2214 $v_result_list[sizeof($v_result_list)] = $v_descr; 2215 2215 2216 2216 // ----- Look for folder 2217 2217 if ($v_descr['type'] == 'folder') { … … 2227 2227 continue; 2228 2228 } 2229 2229 2230 2230 // ----- Compose the full filename 2231 2231 $v_dirlist_descr[$v_dirlist_nb]['filename'] = $v_descr['filename'].'/'.$v_item_handler; 2232 2232 2233 2233 // ----- Look for different stored filename 2234 2234 // Because the name of the folder was changed, the name of the … … 2242 2242 } 2243 2243 } 2244 2244 2245 2245 $v_dirlist_nb++; 2246 2246 } 2247 2247 2248 2248 @closedir($v_folder_handler); 2249 2249 } … … 2252 2252 // TBC : unable to open folder in read mode 2253 2253 } 2254 2254 2255 2255 // ----- Expand each element of the list 2256 2256 if ($v_dirlist_nb != 0) { … … 2260 2260 return $v_result; 2261 2261 } 2262 2262 2263 2263 // ----- Concat the resulting list 2264 2264 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Merging result list (size '".sizeof($v_result_list)."') with dirlist (size '".sizeof($v_dirlist_descr)."')"); … … 2269 2269 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Nothing in this folder to expand."); 2270 2270 } 2271 2271 2272 2272 // ----- Free local array 2273 2273 unset($v_dirlist_descr); 2274 2274 } 2275 2275 } 2276 2276 2277 2277 // ----- Get the result list 2278 2278 $p_filedescr_list = $v_result_list; … … 2295 2295 $v_result=1; 2296 2296 $v_list_detail = array(); 2297 2297 2298 2298 // ----- Magic quotes trick 2299 2299 $this->privDisableMagicQuotes(); … … 2656 2656 // Description : 2657 2657 // Parameters : 2658 // $p_filedescr_list : An array containing the file description 2658 // $p_filedescr_list : An array containing the file description 2659 2659 // or directory names to add in the zip 2660 2660 // $p_result_list : list of added files with their properties (specially the status field) … … 2676 2676 $p_filedescr_list[$j]['filename'] 2677 2677 = PclZipUtilTranslateWinPath($p_filedescr_list[$j]['filename'], false); 2678 2678 2679 2679 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Looking for file '".$p_filedescr_list[$j]['filename']."'"); 2680 2680 … … 2736 2736 //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddFile", "filename='".$p_filedescr['filename']."'"); 2737 2737 $v_result=1; 2738 2738 2739 2739 // ----- Working variable 2740 2740 $p_filename = $p_filedescr['filename']; … … 2749 2749 return PclZip::errorCode(); 2750 2750 } 2751 2752 // ----- Look for a stored different filename 2751 2752 // ----- Look for a stored different filename 2753 2753 /* TBC : Removed 2754 2754 if (isset($p_filedescr['stored_filename'])) { … … 2787 2787 $p_header['size'] = filesize($p_filename); 2788 2788 } 2789 2789 2790 2790 // ----- Look for regular folder 2791 2791 else if ($p_filedescr['type']=='folder') { … … 2794 2794 $p_header['size'] = filesize($p_filename); 2795 2795 } 2796 2796 2797 2797 // ----- Look for virtual file 2798 2798 else if ($p_filedescr['type'] == 'virtual_file') { … … 2800 2800 $p_header['size'] = strlen($p_filedescr['content']); 2801 2801 } 2802 2802 2803 2803 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Header external extension '".sprintf("0x%X",$p_header['external'])."'"); 2804 2804 … … 2856 2856 $p_header['status'] = "filtered"; 2857 2857 } 2858 2858 2859 2859 // ----- Check the path length 2860 2860 if (strlen($p_header['stored_filename']) > 0xFF) { … … 2868 2868 if ($p_filedescr['type'] == 'file') { 2869 2869 // ----- Look for using temporary file to zip 2870 if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) 2870 if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) 2871 2871 && (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON]) 2872 2872 || (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]) … … 2877 2877 } 2878 2878 } 2879 2879 2880 2880 // ----- Use "in memory" zip algo 2881 2881 else { 2882 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"In memory compression."); 2883 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Current memory usage : ".memory_get_usage(TRUE)." bytes"); 2884 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Current memory peak : ".memory_get_peak_usage(TRUE)." bytes"); 2882 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"In memory compression."); 2883 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Current memory usage : ".memory_get_usage(TRUE)." bytes"); 2884 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Current memory peak : ".memory_get_peak_usage(TRUE)." bytes"); 2885 2885 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "'".$p_filename."' is a file"); 2886 2886 … … 2894 2894 // ----- Read the file content 2895 2895 $v_content = @fread($v_file, $p_header['size']); 2896 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Memory usage after reading file : ".memory_get_usage(TRUE)." bytes"); 2897 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Memory peak after reading file : ".memory_get_peak_usage(TRUE)." bytes"); 2896 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Memory usage after reading file : ".memory_get_usage(TRUE)." bytes"); 2897 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Memory peak after reading file : ".memory_get_peak_usage(TRUE)." bytes"); 2898 2898 2899 2899 // ----- Close the file … … 2902 2902 // ----- Calculate the CRC 2903 2903 $p_header['crc'] = @crc32($v_content); 2904 2904 2905 2905 // ----- Look for no compression 2906 2906 if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) { … … 2910 2910 $p_header['compression'] = 0; 2911 2911 } 2912 2912 2913 2913 // ----- Look for normal compression 2914 2914 else { … … 2916 2916 // ----- Compress the content 2917 2917 $v_content = @gzdeflate($v_content); 2918 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Memory usage after gzdeflate : ".memory_get_usage(TRUE)." bytes"); 2919 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Memory peak after gzdeflate : ".memory_get_peak_usage(TRUE)." bytes"); 2918 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Memory usage after gzdeflate : ".memory_get_usage(TRUE)." bytes"); 2919 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Memory peak after gzdeflate : ".memory_get_peak_usage(TRUE)." bytes"); 2920 2920 2921 2921 // ----- Set header parameters … … 2923 2923 $p_header['compression'] = 8; 2924 2924 } 2925 2925 2926 2926 // ----- Call the header generation 2927 2927 if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { … … 2940 2940 // ----- Look for a virtual file (a file from string) 2941 2941 else if ($p_filedescr['type'] == 'virtual_file') { 2942 2942 2943 2943 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Add by string"); 2944 2944 $v_content = $p_filedescr['content']; … … 2946 2946 // ----- Calculate the CRC 2947 2947 $p_header['crc'] = @crc32($v_content); 2948 2948 2949 2949 // ----- Look for no compression 2950 2950 if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) { … … 2954 2954 $p_header['compression'] = 0; 2955 2955 } 2956 2956 2957 2957 // ----- Look for normal compression 2958 2958 else { … … 2965 2965 $p_header['compression'] = 8; 2966 2966 } 2967 2967 2968 2968 // ----- Call the header generation 2969 2969 if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { … … 3036 3036 //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddFileUsingTempFile", "filename='".$p_filedescr['filename']."'"); 3037 3037 $v_result=PCLZIP_ERR_NO_ERROR; 3038 3038 3039 3039 // ----- Working variable 3040 3040 $p_filename = $p_filedescr['filename']; … … 3154 3154 // ----- Unlink the temporary file 3155 3155 @unlink($v_gzip_temp_name); 3156 3156 3157 3157 // ----- Return 3158 3158 //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); … … 3173 3173 //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCalculateStoredFilename", "filename='".$p_filedescr['filename']."'"); 3174 3174 $v_result=1; 3175 3175 3176 3176 // ----- Working variables 3177 3177 $p_filename = $p_filedescr['filename']; … … 3202 3202 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Changing full name of '".$p_filename."' for '".$v_stored_filename."'"); 3203 3203 } 3204 3204 3205 3205 // ----- Look for path and/or short name change 3206 3206 else { … … 3235 3235 if ( (substr($p_filename, 0, 2) == "./") 3236 3236 || (substr($p_remove_dir, 0, 2) == "./")) { 3237 3237 3238 3238 if ( (substr($p_filename, 0, 2) == "./") 3239 3239 && (substr($p_remove_dir, 0, 2) != "./")) { … … 3261 3261 } 3262 3262 } 3263 3263 3264 3264 // ----- Remove drive letter if any 3265 3265 $v_stored_filename = PclZipUtilTranslateWinPath($v_stored_filename); 3266 3266 3267 3267 // ----- Look for path to add 3268 3268 if ($p_add_dir != "") { … … 3279 3279 $p_filedescr['stored_filename'] = $v_stored_filename; 3280 3280 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Stored filename will be '".$p_filedescr['stored_filename']."', strlen ".strlen($p_filedescr['stored_filename'])); 3281 3281 3282 3282 // ----- Return 3283 3283 //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); … … 3444 3444 // ----- Magic quotes trick 3445 3445 $this->privSwapBackMagicQuotes(); 3446 3446 3447 3447 // ----- Error log 3448 3448 PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode'); … … 3727 3727 && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) { 3728 3728 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByIndex'"); 3729 3729 3730 3730 // ----- Look if the index is in the list 3731 3731 for ($j=$j_start; ($j<sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_extract); $j++) { … … 3767 3767 3768 3768 $this->privSwapBackMagicQuotes(); 3769 3769 3770 3770 PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_COMPRESSION, 3771 3771 "Filename '".$v_header['stored_filename']."' is " … … 3777 3777 } 3778 3778 } 3779 3779 3780 3780 // ----- Check encrypted files 3781 3781 if (($v_extract) && (($v_header['flag'] & 1) == 1)) { … … 3814 3814 $v_extract = false; 3815 3815 } 3816 3816 3817 3817 // ----- Look for real extraction 3818 3818 if ($v_extract) … … 3868 3868 // ----- Next extracted file 3869 3869 $v_nb_extracted++; 3870 3870 3871 3871 // ----- Look for user callback abort 3872 3872 if ($v_result1 == 2) { … … 4020 4020 $p_entry['filename'] = $p_path."/".$p_entry['filename']; 4021 4021 } 4022 4022 4023 4023 // ----- Check a base_dir_restriction 4024 4024 if (isset($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION])) { … … 4026 4026 $v_inclusion 4027 4027 = PclZipUtilPathInclusion($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION], 4028 $p_entry['filename']); 4028 $p_entry['filename']); 4029 4029 if ($v_inclusion == 0) { 4030 4030 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_EXTRACT_DIR_RESTRICTION is selected, file is outside restriction"); … … 4056 4056 $v_result = 1; 4057 4057 } 4058 4058 4059 4059 // ----- Look for abort result 4060 4060 if ($v_result == 2) { … … 4088 4088 // ----- Change the file status 4089 4089 $p_entry['status'] = "already_a_directory"; 4090 4090 4091 4091 // ----- Look for PCLZIP_OPT_STOP_ON_ERROR 4092 4092 // For historical reason first PclZip implementation does not stop … … 4173 4173 if (($v_result = $this->privDirCheck($v_dir_to_check, (($p_entry['external']&0x00000010)==0x00000010))) != 1) { 4174 4174 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to create path for '".$p_entry['filename']."'"); 4175 4175 4176 4176 // ----- Change the file status 4177 4177 $p_entry['status'] = "path_creation_fail"; 4178 4178 4179 4179 // ----- Return 4180 4180 ////--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); … … 4221 4221 @fwrite($v_dest_file, $v_binary_data, $v_read_size); 4222 4222 */ 4223 @fwrite($v_dest_file, $v_buffer, $v_read_size); 4223 @fwrite($v_dest_file, $v_buffer, $v_read_size); 4224 4224 $v_size -= $v_read_size; 4225 4225 } … … 4230 4230 // ----- Change the file mtime 4231 4231 touch($p_entry['filename'], $p_entry['mtime']); 4232 4232 4233 4233 4234 4234 } … … 4246 4246 4247 4247 // ----- Look for using temporary file to unzip 4248 if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) 4248 if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) 4249 4249 && (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON]) 4250 4250 || (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]) … … 4255 4255 } 4256 4256 } 4257 4257 4258 4258 // ----- Look for extract in memory 4259 4259 else { 4260 4260 4261 4261 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read '".$p_entry['compressed_size']."' compressed bytes"); 4262 4262 4263 4263 // ----- Read the compressed file in a buffer (one shot) 4264 4264 $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); 4265 4265 4266 4266 // ----- Decompress the file 4267 4267 $v_file_content = @gzinflate($v_buffer); … … 4269 4269 if ($v_file_content === FALSE) { 4270 4270 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to inflate compressed file"); 4271 4271 4272 4272 // ----- Change the file status 4273 4273 // TBC 4274 4274 $p_entry['status'] = "error"; 4275 4275 4276 4276 //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); 4277 4277 return $v_result; 4278 4278 } 4279 4279 4280 4280 // ----- Opening destination file 4281 4281 if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) { 4282 4282 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Error while opening '".$p_entry['filename']."' in write binary mode"); 4283 4283 4284 4284 // ----- Change the file status 4285 4285 $p_entry['status'] = "write_error"; 4286 4286 4287 4287 //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); 4288 4288 return $v_result; 4289 4289 } 4290 4290 4291 4291 // ----- Write the uncompressed data 4292 4292 @fwrite($v_dest_file, $v_file_content, $p_entry['size']); 4293 4293 unset($v_file_content); 4294 4294 4295 4295 // ----- Closing the destination file 4296 4296 @fclose($v_dest_file); 4297 4297 4298 4298 } 4299 4299 … … 4318 4318 $p_entry['status'] = "skipped"; 4319 4319 } 4320 4320 4321 4321 // ----- Look for post-extract callback 4322 4322 elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) { … … 4355 4355 //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privExtractFileUsingTempFile', "filename='".$p_entry['filename']."'"); 4356 4356 $v_result=1; 4357 4357 4358 4358 // ----- Creates a temporary file 4359 4359 $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.gz'; … … 4427 4427 // ----- Delete the temporary file 4428 4428 @unlink($v_gzip_temp_name); 4429 4429 4430 4430 // ----- Return 4431 4431 //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); … … 4516 4516 // ----- Read the compressed file in a buffer (one shot) 4517 4517 $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); 4518 4518 4519 4519 // ----- Decompress the file 4520 4520 $v_file_content = gzinflate($v_buffer); … … 4605 4605 // ----- Reading the file 4606 4606 $v_data = @fread($this->zip_fd, $p_entry['compressed_size']); 4607 4607 4608 4608 // ----- Decompress the file 4609 4609 if (($p_string = @gzinflate($v_data)) === FALSE) { … … 4922 4922 //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "filename_len" : TBC To Be Completed'); 4923 4923 } 4924 4924 4925 4925 // ----- Look for flag bit 3 4926 4926 if (($p_local_header['flag'] & 8) == 8) { … … 5027 5027 // ----- Add the byte 5028 5028 // $v_bytes = ($v_bytes << 8) | Ord($v_byte); 5029 // Note we mask the old value down such that once shifted we can never end up with more than a 32bit number 5030 // Otherwise on systems where we have 64bit integers the check below for the magic number will fail. 5031 $v_bytes = ( ($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte); 5029 // Note we mask the old value down such that once shifted we can never end up with more than a 32bit number 5030 // Otherwise on systems where we have 64bit integers the check below for the magic number will fail. 5031 $v_bytes = ( ($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte); 5032 5032 5033 5033 // ----- Compare the bytes … … 5364 5364 return $v_result; 5365 5365 } 5366 5366 5367 5367 // ----- Check that local file header is same as central file header 5368 5368 if ($this->privCheckFileHeaders($v_local_header, … … 5457 5457 //@rename($v_zip_temp_name, $this->zipname); 5458 5458 PclZipUtilRename($v_zip_temp_name, $this->zipname); 5459 5459 5460 5460 // ----- Destroy the temporary archive 5461 5461 unset($v_temp_zip); 5462 5462 } 5463 5463 5464 5464 // ----- Remove every files : reset the file 5465 5465 else if ($v_central_dir['entries'] != 0) { … … 6009 6009 } 6010 6010 } 6011 6011 6012 6012 // ----- Look for skip 6013 6013 if ($v_skip > 0) { … … 6044 6044 //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilPathInclusion", "dir='$p_dir', path='$p_path'"); 6045 6045 $v_result = 1; 6046 6046 6047 6047 // ----- Look for path beginning by ./ 6048 6048 if ( ($p_dir == '.') … … 6235 6235 { 6236 6236 //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilOptionText", "option='".$p_option."'"); 6237 6237 6238 6238 $v_list = get_defined_constants(); 6239 6239 for (reset($v_list); $v_key = key($v_list); next($v_list)) { … … 6247 6247 } 6248 6248 } 6249 6249 6250 6250 $v_result = 'Unknown'; 6251 6251 -
trunk/wp-admin/includes/class-wp-filesystem-direct.php
r11831 r11930 19 19 /** 20 20 * constructor 21 * 21 * 22 22 * @param $arg mixed ingored argument 23 23 */ … … 28 28 /** 29 29 * connect filesystem. 30 * 30 * 31 31 * @return bool Returns true on success or false on failure (always true for WP_Filesystem_Direct). 32 32 */ … … 36 36 /** 37 37 * Reads entire file into a string 38 * 38 * 39 39 * @param $file string Name of the file to read. 40 * @return string|bool The function returns the read data or false on failure. 40 * @return string|bool The function returns the read data or false on failure. 41 41 */ 42 42 function get_contents($file) { … … 45 45 /** 46 46 * Reads entire file into an array 47 * 48 * @param $file string Path to the file. 49 * @return array|bool the file contents in an array or false on failure. 47 * 48 * @param $file string Path to the file. 49 * @return array|bool the file contents in an array or false on failure. 50 50 */ 51 51 function get_contents_array($file) { … … 54 54 /** 55 55 * Write a string to a file 56 * 57 * @param $file string Path to the file where to write the data. 56 * 57 * @param $file string Path to the file where to write the data. 58 58 * @param $contents string The data to write. 59 59 * @param $mode int (optional) The file permissions as octal number, usually 0644. … … 71 71 /** 72 72 * Gets the current working directory 73 * 74 * @return string|bool the current working directory on success, or false on failure. 73 * 74 * @return string|bool the current working directory on success, or false on failure. 75 75 */ 76 76 function cwd() { … … 80 80 * Change directory 81 81 * 82 * @param $dir string The new current directory. 82 * @param $dir string The new current directory. 83 83 * @return bool Returns true on success or false on failure. 84 84 */ … … 88 88 /** 89 89 * Changes file group 90 * 91 * @param $file string Path to the file. 90 * 91 * @param $file string Path to the file. 92 92 * @param $group mixed A group name or number. 93 * @param $recursive bool (optional) If set True changes file group recursivly. Defaults to False. 93 * @param $recursive bool (optional) If set True changes file group recursivly. Defaults to False. 94 94 * @return bool Returns true on success or false on failure. 95 95 */ … … 111 111 /** 112 112 * Changes filesystem permissions 113 * 113 * 114 114 * @param $file string Path to the file. 115 115 * @param $mode int (optional) The permissions as octal number, usually 0644 for files, 0755 for dirs. 116 * @param $recursive bool (optional) If set True changes file group recursivly. Defaults to False. 116 * @param $recursive bool (optional) If set True changes file group recursivly. Defaults to False. 117 117 * @return bool Returns true on success or false on failure. 118 118 */ … … 127 127 $mode = FS_CHMOD_DIR; 128 128 else 129 return false; 129 return false; 130 130 } 131 131 … … 144 144 /** 145 145 * Changes file owner 146 * 147 * @param $file string Path to the file. 146 * 147 * @param $file string Path to the file. 148 148 * @param $owner mixed A user name or number. 149 * @param $recursive bool (optional) If set True changes file owner recursivly. Defaults to False. 149 * @param $recursive bool (optional) If set True changes file owner recursivly. Defaults to False. 150 150 * @return bool Returns true on success or false on failure. 151 151 */ … … 166 166 /** 167 167 * Gets file owner 168 * 169 * @param $file string Path to the file. 168 * 169 * @param $file string Path to the file. 170 170 * @return string Username of the user. 171 171 */ … … 181 181 /** 182 182 * Gets file permissions 183 * 183 * 184 184 * FIXME does not handle errors in fileperms() 185 * 186 * @param $file string Path to the file. 185 * 186 * @param $file string Path to the file. 187 187 * @return string Mode of the file (last 4 digits). 188 188 */ -
trunk/wp-admin/includes/class-wp-filesystem-ftpext.php
r11831 r11930 150 150 $mode = FS_CHMOD_DIR; 151 151 else 152 return false; 152 return false; 153 153 } 154 154 -
trunk/wp-admin/includes/class-wp-filesystem-ftpsockets.php
r11831 r11930 161 161 $mode = FS_CHMOD_DIR; 162 162 else 163 return false; 163 return false; 164 164 } 165 165 -
trunk/wp-admin/includes/class-wp-filesystem-ssh2.php
r11831 r11930 195 195 $mode = FS_CHMOD_DIR; 196 196 else 197 return false; 197 return false; 198 198 } 199 199 -
trunk/wp-admin/includes/class-wp-upgrader.php
r11926 r11930 571 571 return false; 572 572 } 573 573 574 574 $r = $current->response[ $theme ]; 575 575 … … 1007 1007 $stylesheet = $this->upgrader->result['destination_name']; 1008 1008 $template = !empty($theme_info['Template']) ? $theme_info['Template'] : $stylesheet; 1009 1009 1010 1010 $preview_link = htmlspecialchars( add_query_arg( array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'TB_iframe' => 'true' ), trailingslashit(esc_url(get_option('home'))) ) ); 1011 1011 $activate_link = wp_nonce_url("themes.php?action=activate&template=" . urlencode($template) . "&stylesheet=" . urlencode($stylesheet), 'switch-theme_' . $template); 1012 1012 1013 1013 $update_actions = array( 1014 1014 'preview' => '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . esc_attr(sprintf(__('Preview “%s”'), $name)) . '">' . __('Preview') . '</a>', -
trunk/wp-admin/includes/export.php
r11774 r11930 269 269 if ( 'revision' == $post->post_type ) 270 270 continue; 271 setup_postdata($post); 271 setup_postdata($post); 272 272 273 273 $is_sticky = 0; -
trunk/wp-admin/includes/file.php
r11823 r11930 599 599 if( ! file_exists($abstraction_file) ) 600 600 return; 601 601 602 602 require_once($abstraction_file); 603 603 } -
trunk/wp-admin/includes/image-edit.php
r11911 r11930 43 43 <div onclick="imageEdit.flip(1, <?php echo "$post_id, '$nonce'"; ?>)" class="imgedit-fliph" title="<?php echo esc_attr__( 'Flip horizontally' ); ?>"></div> 44 44 <div onclick="imageEdit.flip(2, <?php echo "$post_id, '$nonce'"; ?>)" class="imgedit-flipv" title="<?php echo esc_attr__( 'Flip vertically' ); ?>"></div> 45 45 46 46 <div id="image-undo-<?php echo $post_id; ?>" onclick="imageEdit.undo(<?php echo "$post_id, '$nonce'"; ?>)" class="imgedit-undo disabled" title="<?php echo esc_attr__( 'Undo' ); ?>"></div> 47 47 <div id="image-redo-<?php echo $post_id; ?>" onclick="imageEdit.redo(<?php echo "$post_id, '$nonce'"; ?>)" class="imgedit-redo disabled" title="<?php echo esc_attr__( 'Redo' ); ?>"></div> -
trunk/wp-admin/includes/plugin.php
r11909 r11930 616 616 $menu[$position] = $new_menu; 617 617 } 618 618 619 619 $_registered_pages[$hookname] = true; 620 620 … … 624 624 function add_object_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') { 625 625 global $_wp_last_object_menu; 626 626 627 627 $_wp_last_object_menu++; 628 628 629 629 return add_menu_page($page_title, $menu_title, $access_level, $file, $function, $icon_url, $_wp_last_object_menu); 630 630 } … … 632 632 function add_utility_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') { 633 633 global $_wp_last_utility_menu; 634 634 635 635 $_wp_last_utility_menu++; 636 636 637 637 return add_menu_page($page_title, $menu_title, $access_level, $file, $function, $icon_url, $_wp_last_utility_menu); 638 638 } … … 675 675 $_registered_pages[$hookname] = true; 676 676 // backwards-compatibility for plugins using add_management page. See wp-admin/admin.php for redirect from edit.php to tools.php 677 if ( 'tools.php' == $parent ) 677 if ( 'tools.php' == $parent ) 678 678 $_registered_pages[get_plugin_page_hookname( $file, 'edit.php')] = true; 679 679 -
trunk/wp-admin/includes/post.php
r11928 r11930 1079 1079 /** 1080 1080 * Outputs the notice message to say that someone else is editing this post at the moment. 1081 * 1081 * 1082 1082 * @since 2.9.0 1083 1083 * @return none … … 1087 1087 $last_user = get_userdata( get_post_meta( $post->ID, '_edit_last', true ) ); 1088 1088 $last_user_name = $last_user ? $last_user->display_name : __('Somebody'); 1089 1089 1090 1090 switch ($post->post_type) { 1091 1091 case 'post': … … 1098 1098 $message = __( 'Warning: %s is currently editing this.' ); 1099 1099 } 1100 1100 1101 1101 $message = sprintf( $message, esc_html( $last_user_name ) ); 1102 echo "<div class='error'><p>$message</p></div>"; 1102 echo "<div class='error'><p>$message</p></div>"; 1103 1103 } 1104 1104 -
trunk/wp-admin/includes/template.php
r11929 r11930 2066 2066 $query .= "AND $approved $post $typesql"; 2067 2067 } 2068 2068 2069 2069 $comments = $wpdb->get_results("SELECT * $query $orderby"); 2070 2070 if ( '' === $total ) -
trunk/wp-admin/install.php
r11834 r11930 55 55 $blog_public = isset($_POST['blog_public']); 56 56 } 57 57 58 58 if ( ! is_null( $error ) ) { 59 59 ?> -
trunk/wp-admin/media.php
r11911 r11930 61 61 if ( empty($att->ID) ) wp_die( __('You attempted to edit an attachment that doesn’t exist. Perhaps it was deleted?') ); 62 62 if ( $att->post_status == 'trash' ) wp_die( __('You can’t edit this attachment because it is in the Trash. Please move it out of the Trash and try again.') ); 63 63 64 64 add_filter('attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2); 65 65 -
trunk/wp-admin/menu-header.php
r11582 r11930 132 132 if ( ( ('index.php' != $sub_item[2]) && file_exists(WP_PLUGIN_DIR . "/$sub_file") ) || ! empty($menu_hook) ) { 133 133 // If admin.php is the current page or if the parent exists as a file in the plugins or admin dir 134 134 135 135 $parent_exists = (!$admin_is_parent && file_exists(WP_PLUGIN_DIR . "/$menu_file") && !is_dir(WP_PLUGIN_DIR . "/{$item[2]}") ) || file_exists($menu_file); 136 136 if ( $parent_exists ) -
trunk/wp-admin/plugins.php
r11761 r11930 62 62 if ( ! current_user_can('activate_plugins') ) 63 63 wp_die(__('You do not have sufficient permissions to activate plugins for this blog.')); 64 64 65 65 check_admin_referer('bulk-manage-plugins'); 66 66 -
trunk/wp-admin/upgrade.php
r11610 r11930 69 69 case 1: 70 70 wp_upgrade(); 71 71 72 72 $backto = empty($_GET['backto']) ? '' : $_GET['backto'] ; 73 73 $backto = stripslashes( urldecode( $backto ) ); -
trunk/wp-admin/upload.php
r11841 r11930 70 70 } elseif ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) { 71 71 check_admin_referer('bulk-media'); 72 72 73 73 if ( isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) { 74 74 $post_ids = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_type='attachment' AND post_status = 'trash'" ); … … 79 79 } else 80 80 wp_redirect($_SERVER['HTTP_REFERER']); 81 81 82 82 $location = 'upload.php'; 83 83 if ( $referer = wp_get_referer() ) { … … 91 91 if ( !current_user_can('delete_post', $post_id) ) 92 92 wp_die( __('You are not allowed to move this post to the trash.') ); 93 93 94 94 if ( !wp_trash_post($post_id) ) 95 95 wp_die( __('Error in moving to trash...') ); … … 101 101 if ( !current_user_can('delete_post', $post_id) ) 102 102 wp_die( __('You are not allowed to move this post out of the trash.') ); 103 103 104 104 if ( !wp_untrash_post($post_id) ) 105 105 wp_die( __('Error in restoring from trash...') ); … … 111 111 if ( !current_user_can('delete_post', $post_id_del) ) 112 112 wp_die( __('You are not allowed to delete this post.') ); 113 113 114 114 if ( !wp_delete_attachment($post_id_del) ) 115 115 wp_die( __('Error in deleting...') ); -
trunk/wp-admin/user-edit.php
r11929 r11930 274 274 <th><label for="<?php echo $name; ?>"><?php echo apply_filters('user_'.$name.'_label', $desc); ?></label></th> 275 275 <td><input type="text" name="<?php echo $name; ?>" id="<?php echo $name; ?>" value="<?php echo esc_attr($profileuser->$name) ?>" class="regular-text" /></td> 276 </tr> 276 </tr> 277 277 <?php 278 278 } -
trunk/wp-app.php
r11812 r11930 782 782 783 783 $location = get_post_meta($entry['ID'], '_wp_attached_file', true); 784 $location = get_option ('upload_path') . '/' . $location; 784 $location = get_option ('upload_path') . '/' . $location; 785 785 $filetype = wp_check_filetype($location); 786 786 … … 792 792 header('Connection: close'); 793 793 794 if ($fp = fopen($location, "rb")) { 795 status_header('200'); 796 header('Content-Type: ' . $entry['post_mime_type']); 794 if ($fp = fopen($location, "rb")) { 795 status_header('200'); 796 header('Content-Type: ' . $entry['post_mime_type']); 797 797 header('Connection: close'); 798 798 -
trunk/wp-includes/canonical.php
r11869 r11930 96 96 } 97 97 } elseif ( is_single() && !empty($_GET['name']) && ! $redirect_url ) { 98 if ( $redirect_url = get_permalink( $wp_query->get_queried_object_id() ) ) 99 $redirect['query'] = remove_query_arg('name', $redirect['query']); 98 if ( $redirect_url = get_permalink( $wp_query->get_queried_object_id() ) ) 99 $redirect['query'] = remove_query_arg('name', $redirect['query']); 100 100 } elseif ( is_page() && !empty($_GET['page_id']) && ! $redirect_url ) { 101 101 if ( $redirect_url = get_permalink(get_query_var('page_id')) ) -
trunk/wp-includes/class-json.php
r11877 r11930 267 267 function _encode($var) 268 268 { 269 269 270 270 switch (gettype($var)) { 271 271 case 'boolean': -
trunk/wp-includes/classes.php
r11853 r11930 215 215 // Trim the query of everything up to the '?'. 216 216 $query = preg_replace("!^.+\?!", '', $query); 217 217 218 218 // Substitute the substring matches into the query. 219 219 $query = addslashes(WP_MatchesMapRegex::apply($query, $matches)); … … 1595 1595 /** 1596 1596 * Helper class to remove the need to use eval to replace $matches[] in query strings. 1597 * 1597 * 1598 1598 * @since 2.9.0 1599 1599 */ … … 1601 1601 /** 1602 1602 * store for matches 1603 * 1603 * 1604 1604 * @access private 1605 1605 * @var array 1606 1606 */ 1607 1607 var $_matches; 1608 1608 1609 1609 /** 1610 1610 * store for mapping result 1611 * 1611 * 1612 1612 * @access public 1613 1613 * @var string 1614 1614 */ 1615 1615 var $output; 1616 1616 1617 1617 /** 1618 1618 * subject to perform mapping on (query string containing $matches[] references 1619 * 1619 * 1620 1620 * @access private 1621 1621 * @var string 1622 1622 */ 1623 1623 var $_subject; 1624 1625 /** 1626 * regexp pattern to match $matches[] references 1627 * 1624 1625 /** 1626 * regexp pattern to match $matches[] references 1627 * 1628 1628 * @var string 1629 1629 */ 1630 1630 var $_pattern = '(\$matches\[[1-9]+[0-9]*\])'; // magic number 1631 1631 1632 1632 /** 1633 1633 * constructor 1634 * 1634 * 1635 1635 * @param string $subject subject if regex 1636 1636 * @param array $matches data to use in map 1637 1637 * @return self 1638 */ 1638 */ 1639 1639 function WP_MatchesMapRegex($subject, $matches) { 1640 1640 $this->_subject = $subject; 1641 1641 $this->_matches = $matches; 1642 $this->output = $this->_map(); 1643 } 1644 1642 $this->output = $this->_map(); 1643 } 1644 1645 1645 /** 1646 1646 * Substitute substring matches in subject. 1647 * 1647 * 1648 1648 * static helper function to ease use 1649 * 1649 * 1650 1650 * @access public 1651 1651 * @param string $subject subject … … 1655 1655 function apply($subject, $matches) { 1656 1656 $oSelf =& new WP_MatchesMapRegex($subject, $matches); 1657 return $oSelf->output; 1658 } 1659 1660 /** 1661 * do the actual mapping 1662 * 1657 return $oSelf->output; 1658 } 1659 1660 /** 1661 * do the actual mapping 1662 * 1663 1663 * @access private 1664 1664 * @return string … … 1668 1668 return preg_replace_callback($this->_pattern, $callback, $this->_subject); 1669 1669 } 1670 1670 1671 1671 /** 1672 1672 * preg_replace_callback hook 1673 * 1673 * 1674 1674 * @access public 1675 1675 * @param array $matches preg_replace regexp matches … … 1680 1680 return ( isset( $this->_matches[$index] ) ? $this->_matches[$index] : '' ); 1681 1681 } 1682 1682 1683 1683 } 1684 1684 -
trunk/wp-includes/comment-template.php
r11895 r11930 836 836 /** 837 837 * The email address of the current comment author escaped for use in attributes. 838 */ 838 */ 839 839 $comment_author_email = $commenter['comment_author_email']; // Escaped by sanitize_comment_cookies() 840 840 841 841 /** 842 842 * The url of the current comment author escaped for use in attributes. 843 */ 843 */ 844 844 $comment_author_url = esc_url($commenter['comment_author_url']); 845 845 -
trunk/wp-includes/comment.php
r11860 r11930 735 735 if (wp_get_comment_status($comment_id) != 'trash' && wp_get_comment_status($comment_id) != 'spam' && EMPTY_TRASH_DAYS > 0) 736 736 return wp_trash_comment($comment_id); 737 737 738 738 do_action('delete_comment', $comment_id); 739 739 740 740 $trash_meta = get_option('wp_trash_meta'); 741 741 if (is_array($trash_meta) && isset($trash_meta['comments'][$comment_id])) { … … 1094 1094 function wp_set_comment_status($comment_id, $comment_status, $wp_error = false) { 1095 1095 global $wpdb; 1096 1096 1097 1097 $status = '0'; 1098 1098 switch ( $comment_status ) { -
trunk/wp-includes/formatting.php
r11929 r11930 33 33 $textarr = preg_split('/(<.*>|\[.*\])/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE); 34 34 $stop = count($textarr); 35 35 36 36 /* translators: opening curly quote */ 37 37 $opening_quote = _x('“', 'opening curly quote'); 38 38 /* translators: closing curly quote */ 39 39 $closing_quote = _x('”', 'closing curly quote'); 40 40 41 41 $no_texturize_tags = apply_filters('no_texturize_tags', array('pre', 'code', 'kbd', 'style', 'script', 'tt')); 42 42 $no_texturize_shortcodes = apply_filters('no_texturize_shortcodes', array('code')); … … 1327 1327 $img = $wpsmiliestrans[$smiley]; 1328 1328 $smiley_masked = esc_attr($smiley); 1329 1329 1330 1330 $srcurl = apply_filters('smilies_src', "$siteurl/wp-includes/images/smilies/$img", $img, $siteurl); 1331 1331 … … 2088 2088 /** 2089 2089 * Perform a deep string replace operation to ensure the values in $search are no longer present 2090 * 2090 * 2091 2091 * Repeats the replacement operation until it no longer replaces anything so as to remove "nested" values 2092 2092 * e.g. $subject = '%0%0%0DDD', $search ='%0D', $result ='' rather than the '%0%0DD' that 2093 2093 * str_replace would return 2094 * 2094 * 2095 2095 * @since 2.8.1 2096 2096 * @access private 2097 * 2097 * 2098 2098 * @param string|array $search 2099 2099 * @param string $subject … … 2111 2111 } 2112 2112 } 2113 2113 2114 2114 return $subject; 2115 2115 } -
trunk/wp-includes/functions.php
r11903 r11930 3309 3309 } else { 3310 3310 // It's inside a continent group 3311 3311 3312 3312 // Continent optgroup 3313 3313 if ( !isset( $zonen[$key - 1] ) || $zonen[$key - 1]['continent'] !== $zone['continent'] ) { … … 3315 3315 $structure[] = '<optgroup label="'. esc_attr( $label ) .'">'; 3316 3316 } 3317 3317 3318 3318 // Add the city to the value 3319 3319 $value[] = $zone['city']; … … 3343 3343 } 3344 3344 $structure[] = '<option ' . $selected . 'value="' . esc_attr( $value ) . '">' . esc_html( $display ) . "</option>"; 3345 3345 3346 3346 // Close continent optgroup 3347 3347 if ( !empty( $zone['city'] ) && ( !isset($zonen[$key + 1]) || (isset( $zonen[$key + 1] ) && $zonen[$key + 1]['continent'] !== $zone['continent']) ) ) { … … 3365 3365 /** 3366 3366 * Permanently deletes posts, pages, attachments, and comments which have been in the trash for EMPTY_TRASH_DAYS. 3367 * 3367 * 3368 3368 * @since 2.9.0 3369 3369 * … … 3374 3374 3375 3375 $delete_timestamp = time() - (60*60*24*EMPTY_TRASH_DAYS); 3376 3376 3377 3377 $posts_to_delete = $wpdb->get_results($wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wp_trash_meta_time' AND meta_value < '%d'", $delete_timestamp), ARRAY_A); 3378 3378 3379 3379 foreach ( (array) $posts_to_delete as $post ) { 3380 3380 wp_delete_post($post['post_id']); … … 3382 3382 3383 3383 //Trashed Comments 3384 //TODO Come up with a better store for the comment trash meta. 3384 //TODO Come up with a better store for the comment trash meta. 3385 3385 $trash_meta = get_option('wp_trash_meta'); 3386 3386 if ( !is_array($trash_meta) ) -
trunk/wp-includes/http.php
r11835 r11930 1814 1814 * Decompression of deflated string while staying compatible with the majority of servers. 1815 1815 * 1816 * Certain Servers will return deflated data with headers which PHP's gziniflate() 1816 * Certain Servers will return deflated data with headers which PHP's gziniflate() 1817 1817 * function cannot handle out of the box. The following function lifted from 1818 * http://au2.php.net/manual/en/function.gzinflate.php#77336 will attempt to deflate 1819 * the various return forms used. 1818 * http://au2.php.net/manual/en/function.gzinflate.php#77336 will attempt to deflate 1819 * the various return forms used. 1820 1820 * 1821 1821 * @since 2.8.1 -
trunk/wp-includes/kses.php
r11828 r11930 1177 1177 1178 1178 $css_array = split( ';', trim( $css ) ); 1179 $allowed_attr = apply_filters( 'safe_style_css', array( 'text-align', 'margin', 'color', 'float', 1180 'border', 'background', 'background-color', 'border-bottom', 'border-bottom-color', 1179 $allowed_attr = apply_filters( 'safe_style_css', array( 'text-align', 'margin', 'color', 'float', 1180 'border', 'background', 'background-color', 'border-bottom', 'border-bottom-color', 1181 1181 'border-bottom-style', 'border-bottom-width', 'border-collapse', 'border-color', 'border-left', 1182 'border-left-color', 'border-left-style', 'border-left-width', 'border-right', 'border-right-color', 1183 'border-right-style', 'border-right-width', 'border-spacing', 'border-style', 'border-top', 1184 'border-top-color', 'border-top-style', 'border-top-width', 'border-width', 'caption-side', 1185 'clear', 'cursor', 'direction', 'font', 'font-family', 'font-size', 'font-style', 1186 'font-variant', 'font-weight', 'height', 'letter-spacing', 'line-height', 'margin-bottom', 1187 'margin-left', 'margin-right', 'margin-top', 'overflow', 'padding', 'padding-bottom', 1188 'padding-left', 'padding-right', 'padding-top', 'text-decoration', 'text-indent', 'vertical-align', 1182 'border-left-color', 'border-left-style', 'border-left-width', 'border-right', 'border-right-color', 1183 'border-right-style', 'border-right-width', 'border-spacing', 'border-style', 'border-top', 1184 'border-top-color', 'border-top-style', 'border-top-width', 'border-width', 'caption-side', 1185 'clear', 'cursor', 'direction', 'font', 'font-family', 'font-size', 'font-style', 1186 'font-variant', 'font-weight', 'height', 'letter-spacing', 'line-height', 'margin-bottom', 1187 'margin-left', 'margin-right', 'margin-top', 'overflow', 'padding', 'padding-bottom', 1188 'padding-left', 'padding-right', 'padding-top', 'text-decoration', 'text-indent', 'vertical-align', 1189 1189 'width' ) ); 1190 1190 -
trunk/wp-includes/link-template.php
r11906 r11930 1649 1649 function get_shortcut_link() { 1650 1650 $link = "javascript: 1651 var d=document, 1652 w=window, 1653 e=w.getSelection, 1654 k=d.getSelection, 1651 var d=document, 1652 w=window, 1653 e=w.getSelection, 1654 k=d.getSelection, 1655 1655 x=d.selection, 1656 1656 s=(e?e():(k)?k():(x?x.createRange().text:0)), -
trunk/wp-includes/media.php
r11911 r11930 350 350 351 351 imagecopyresampled( $newimage, $image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); 352 352 353 353 // convert from full colors to index colors, like original PNG. 354 354 if ( IMAGETYPE_PNG == $orig_type && !imageistruecolor( $image ) ) … … 379 379 // all other formats are converted to jpg 380 380 $destfilename = "{$dir}/{$name}-{$suffix}.jpg"; 381 if ( !imagejpeg( $newimage, $destfilename, apply_filters( 'jpeg_quality', $jpeg_quality, 'image_resize' ) ) ) 381 if ( !imagejpeg( $newimage, $destfilename, apply_filters( 'jpeg_quality', $jpeg_quality, 'image_resize' ) ) ) 382 382 return new WP_Error('resize_path_invalid', __( 'Resize path invalid' )); 383 383 } … … 838 838 case 'image/gif': 839 839 return function_exists('imagecreatefromgif'); 840 } 840 } 841 841 } 842 842 return false; -
trunk/wp-includes/pluggable.php
r11905 r11930 999 999 $notify_message .= __('Excerpt: ') . "\r\n" . $comment->comment_content . "\r\n\r\n"; 1000 1000 $notify_message .= __('You can see all trackbacks on this post here: ') . "\r\n"; 1001 /* translators: 1: blog name, 2: post title */ 1001 /* translators: 1: blog name, 2: post title */ 1002 1002 $subject = sprintf( __('[%1$s] Trackback: "%2$s"'), $blogname, $post->post_title ); 1003 1003 } elseif ('pingback' == $comment_type) { -
trunk/wp-includes/post.php
r11911 r11930 136 136 137 137 $children = get_posts( $r ); 138 138 139 139 if ( !$children ) 140 140 return $kids; … … 584 584 585 585 wp_cache_delete($post_id, 'post_meta'); 586 586 587 587 do_action( 'deleted_post_meta', $meta_id, $post_id, $meta_key, $meta_value ); 588 588 … … 673 673 674 674 do_action( 'update_post_meta', $meta_id, $post_id, $meta_key, $meta_value ); 675 675 676 676 $wpdb->update( $wpdb->postmeta, $data, $where ); 677 677 wp_cache_delete($post_id, 'post_meta'); 678 678 679 679 do_action( 'updated_post_meta', $meta_id, $post_id, $meta_key, $meta_value ); 680 680 681 681 return true; 682 682 } … … 1155 1155 if ( ($post->post_type == 'post' || $post->post_type == 'page') && get_post_status($postid) != 'trash' && EMPTY_TRASH_DAYS > 0 ) 1156 1156 return wp_trash_post($postid); 1157 1157 1158 1158 if ( $post->post_type == 'attachment' ) 1159 1159 return wp_delete_attachment($postid); 1160 1160 1161 1161 do_action('delete_post', $postid); 1162 1162 1163 1163 delete_post_meta($postid,'_wp_trash_meta_status'); 1164 1164 delete_post_meta($postid,'_wp_trash_meta_time'); … … 1820 1820 if ( in_array( $post_status, array( 'draft', 'pending' ) ) ) 1821 1821 return $slug; 1822 1822 1823 1823 global $wpdb, $wp_rewrite; 1824 1824 $hierarchical_post_types = apply_filters('hierarchical_post_types', array('page')); … … 1827 1827 $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND ID != %d LIMIT 1"; 1828 1828 $post_name_check = $wpdb->get_var($wpdb->prepare($check_sql, $slug, $post_ID)); 1829 1829 1830 1830 if ( $post_name_check || in_array($slug, $wp_rewrite->feeds) ) { 1831 1831 $suffix = 2; … … 1842 1842 $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type IN ( '" . implode("', '", $wpdb->escape($hierarchical_post_types)) . "' ) AND ID != %d AND post_parent = %d LIMIT 1"; 1843 1843 $post_name_check = $wpdb->get_var($wpdb->prepare($check_sql, $slug, $post_ID, $post_parent)); 1844 1844 1845 1845 if ( $post_name_check || in_array($slug, $wp_rewrite->feeds) ) { 1846 1846 $suffix = 2; … … 1856 1856 $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %s AND ID != %d LIMIT 1"; 1857 1857 $post_name_check = $wpdb->get_var($wpdb->prepare($check_sql, $slug, $post_type, $post_ID)); 1858 1858 1859 1859 if ( $post_name_check || in_array($slug, $wp_rewrite->feeds) ) { 1860 1860 $suffix = 2; -
trunk/wp-includes/query.php
r11822 r11930 2698 2698 2699 2699 do_action_ref_array('the_post', array(&$post)); 2700 2700 2701 2701 return true; 2702 2702 } -
trunk/wp-includes/registration.php
r11929 r11930 307 307 * 308 308 * @access private 309 * @since 309 * @since 310 310 * 311 311 * @return array $user_contactmethods Array of contact methods and their labels. -
trunk/wp-includes/script-loader.php
r11928 r11930 453 453 // Register "meta" stylesheet for admin colors. All colors-* style sheets should have the same version string. 454 454 $styles->add( 'colors', true, array(), $colors_version ); 455 455 456 456 // do not refer to these directly, the right one is queued by the above "meta" colors handle 457 457 $styles->add( 'colors-fresh', "/wp-admin/css/colors-fresh$suffix.css", array(), $colors_version); -
trunk/wp-includes/theme.php
r11814 r11930 605 605 606 606 $templates = array(); 607 607 608 608 if ( !is_wp_error($category) ) 609 609 $templates[] = "category-{$category->slug}.php"; 610 610 611 611 $templates[] = "category-$cat_ID.php"; 612 $templates[] = "category.php"; 613 612 $templates[] = "category.php"; 613 614 614 $template = locate_template($templates); 615 615 return apply_filters('category_template', $template); -
trunk/wp-includes/user.php
r11929 r11930 421 421 wp_cache_delete($user_id, 'users'); 422 422 423 if ( !$cur ) 423 if ( !$cur ) 424 424 do_action( 'added_usermeta', $wpdb->insert_id, $user_id, $meta_key, $meta_value ); 425 425 else -
trunk/wp-includes/wp-db.php
r11902 r11930 264 264 var $old_tables = array('categories', 'post2cat', 'link2cat'); 265 265 266 266 267 267 /** 268 268 * Format specifiers for DB columns. Columns not listed here default to %s. Initialized in wp-settings.php. -
trunk/wp-login.php
r11874 r11930 60 60 if ( $is_iphone ) { 61 61 ?> 62 <meta name="viewport" content="width=320; initial-scale=0.9; maximum-scale=1.0; user-scalable=0;" /> 63 <style type="text/css" media="screen"> 62 <meta name="viewport" content="width=320; initial-scale=0.9; maximum-scale=1.0; user-scalable=0;" /> 63 <style type="text/css" media="screen"> 64 64 form { margin-left: 0px; } 65 65 #login { margin-top: 20px; }
Note: See TracChangeset
for help on using the changeset viewer.