Changes from branches/3.0/wp-admin/includes/file.php at r16367 to trunk/wp-admin/includes/file.php at r17200
- File:
-
- 1 edited
-
trunk/wp-admin/includes/file.php (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/file.php
r16367 r17200 8 8 9 9 /** The descriptions for theme files. */ 10 $wp_file_descriptions = array (10 $wp_file_descriptions = array( 11 11 'index.php' => __( 'Main Index Template' ), 12 12 'style.css' => __( 'Stylesheet' ), 13 13 'editor-style.css' => __( 'Visual Editor Stylesheet' ), 14 'editor-style-rtl.css' => __( 'Visual Editor RTL Stylesheet' ), 14 15 'rtl.css' => __( 'RTL Stylesheet' ), 15 16 'comments.php' => __( 'Comments' ), … … 37 38 '.htaccess' => __( '.htaccess (for rewrite rules )' ), 38 39 // Deprecated files 39 'wp-layout.css' => __( 'Stylesheet' ), 'wp-comments.php' => __( 'Comments Template' ), 'wp-comments-popup.php' => __( 'Popup Comments Template' )); 40 41 /** 42 * {@internal Missing Short Description}} 43 * 44 * @since unknown 45 * 46 * @param unknown_type $file 47 * @return unknown 40 'wp-layout.css' => __( 'Stylesheet' ), 41 'wp-comments.php' => __( 'Comments Template' ), 42 'wp-comments-popup.php' => __( 'Popup Comments Template' ), 43 ); 44 45 /** 46 * Get the description for standard WordPress theme files and other various standard 47 * WordPress files 48 * 49 * @since 1.5.0 50 * 51 * @uses _cleanup_header_comment 52 * @uses $wp_file_descriptions 53 * @param string $file Filesystem path or filename 54 * @return string Description of file from $wp_file_descriptions or basename of $file if description doesn't exist 48 55 */ 49 56 function get_file_description( $file ) { … … 56 63 $template_data = implode( '', file( $file ) ); 57 64 if ( preg_match( '|Template Name:(.*)$|mi', $template_data, $name )) 58 return _cleanup_header_comment($name[1]) . ' Page Template';65 return sprintf( __( '%s Page Template' ), _cleanup_header_comment($name[1]) ); 59 66 } 60 67 … … 63 70 64 71 /** 65 * {@internal Missing Short Description}} 66 * 67 * @since unknown 68 * 69 * @return unknown 72 * Get the absolute filesystem path to the root of the WordPress installation 73 * 74 * @since 1.5.0 75 * 76 * @uses get_option 77 * @return string Full filesystem path to the root of the WordPress installation 70 78 */ 71 79 function get_home_path() { … … 85 93 86 94 /** 87 * {@internal Missing Short Description}} 88 * 89 * @since unknown 90 * 91 * @param unknown_type $file 92 * @return unknown 95 * Get the real file system path to a file to edit within the admin 96 * 97 * If the $file is index.php or .htaccess this function will assume it is relative 98 * to the install root, otherwise it is assumed the file is relative to the wp-content 99 * directory 100 * 101 * @since 1.5.0 102 * 103 * @uses get_home_path 104 * @uses WP_CONTENT_DIR full filesystem path to the wp-content directory 105 * @param string $file filesystem path relative to the WordPress install directory or to the wp-content directory 106 * @return string full file system path to edit 93 107 */ 94 108 function get_real_file_to_edit( $file ) { … … 202 216 203 217 /** 204 * {@internal Missing Short Description}} 205 * 206 * @since unknown 207 * 208 * @param unknown_type $file 209 * @param unknown_type $allowed_files 210 * @return unknown 218 * Make sure that the file that was requested to edit, is allowed to be edited 219 * 220 * Function will die if if you are not allowed to edit the file 221 * 222 * @since 1.5.0 223 * 224 * @uses wp_die 225 * @uses validate_file 226 * @param string $file file the users is attempting to edit 227 * @param array $allowed_files Array of allowed files to edit, $file must match an entry exactly 228 * @return null 211 229 */ 212 230 function validate_file_to_edit( $file, $allowed_files = '' ) { … … 229 247 230 248 /** 231 * {@internal Missing Short Description}} 232 * 233 * @since unknown 234 * 249 * Handle PHP uploads in WordPress, sanitizing file names, checking extensions for mime type, 250 * and moving the file to the appropriate directory within the uploads directory. 251 * 252 * @since 2.0 253 * 254 * @uses wp_handle_upload_error 255 * @uses apply_filters 256 * @uses is_multisite 257 * @uses wp_check_filetype_and_ext 258 * @uses current_user_can 259 * @uses wp_upload_dir 260 * @uses wp_unique_filename 261 * @uses delete_transient 235 262 * @param array $file Reference to a single element of $_FILES. Call the function once for each uploaded file. 236 263 * @param array $overrides Optional. An associative array of names=>values to override default variables with extract( $overrides, EXTR_OVERWRITE ). … … 316 343 317 344 if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) ) 318 return call_user_func($upload_error_handler, $file, __( ' File type does not meet security guidelines. Try another.' ));345 return call_user_func($upload_error_handler, $file, __( 'Sorry, this file type is not permitted for security reasons.' )); 319 346 320 347 if ( !$ext ) … … 353 380 354 381 /** 355 * {@internal Missing Short Description}} 356 * 357 * Pass this function an array similar to that of a $_FILES POST array. 358 * 359 * @since unknown 360 * 361 * @param unknown_type $file 362 * @param unknown_type $overrides 363 * @return unknown 382 * Handle sideloads, which is the process of retriving a media item from another server instead of 383 * a traditional media upload. This process involves sanitizing the filename, checking extensions 384 * for mime type, and moving the file to the appropriate directory within the uploads directory. 385 * 386 * @since 2.6.0 387 * 388 * @uses wp_handle_upload_error 389 * @uses apply_filters 390 * @uses wp_check_filetype_and_ext 391 * @uses current_user_can 392 * @uses wp_upload_dir 393 * @uses wp_unique_filename 394 * @param array $file an array similar to that of a PHP $_FILES POST array 395 * @param array $overrides Optional. An associative array of names=>values to override default variables with extract( $overrides, EXTR_OVERWRITE ). 396 * @return array On success, returns an associative array of file attributes. On failure, returns $overrides['upload_error_handler'](&$file, $message ) or array( 'error'=>$message ). 364 397 */ 365 398 function wp_handle_sideload( &$file, $overrides = false ) { … … 430 463 431 464 if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) ) 432 return $upload_error_handler( $file, __( ' File type does not meet security guidelines. Try another.' ));465 return $upload_error_handler( $file, __( 'Sorry, this file type is not permitted for security reasons.' )); 433 466 434 467 if ( !$ext ) … … 475 508 * 476 509 * @param string $url the URL of the file to download 510 * @param int $timeout The timeout for the request to download the file default 300 seconds 477 511 * @return mixed WP_Error on failure, string Filename on success. 478 512 */ 479 function download_url( $url ) {513 function download_url( $url, $timeout = 300 ) { 480 514 //WARNING: The file is not automatically deleted, The script must unlink() the file. 481 515 if ( ! $url ) … … 490 524 return new WP_Error('http_no_file', __('Could not create Temporary file.')); 491 525 492 $response = wp_remote_get($url, array('timeout' => 300));526 $response = wp_remote_get($url, array('timeout' => $timeout)); 493 527 494 528 if ( is_wp_error($response) ) { … … 937 971 $error_string = __('<strong>Error:</strong> There was an error connecting to the server, Please verify the settings are correct.'); 938 972 if ( is_wp_error($error) ) 939 $error_string = $error->get_error_message();940 echo '<div id="message" class="error"><p>' . esc_html( $error_string ). '</p></div>';973 $error_string = esc_html( $error->get_error_message() ); 974 echo '<div id="message" class="error"><p>' . $error_string . '</p></div>'; 941 975 } 942 976 … … 972 1006 $label_user = __('Username'); 973 1007 $label_pass = __('Password'); 974 _e('To perform the requested action, WordPress needs to access toyour web server.');1008 _e('To perform the requested action, WordPress needs to access your web server.'); 975 1009 echo ' '; 976 1010 if ( ( isset( $types['ftp'] ) || isset( $types['ftps'] ) ) ) { … … 1038 1072 echo '<input type="hidden" name="' . esc_attr( $field ) . '" value="' . esc_attr( stripslashes( $_POST[ $field ] ) ) . '" />'; 1039 1073 } 1074 submit_button( __( 'Proceed' ), 'button', 'upgrade' ); 1040 1075 ?> 1041 <p class="submit">1042 <input id="upgrade" name="upgrade" type="submit" class="button" value="<?php esc_attr_e('Proceed'); ?>" />1043 </p>1044 1076 </div> 1045 1077 </form>
Note: See TracChangeset
for help on using the changeset viewer.