Changes from trunk/wp-admin/includes/file.php at r17200 to branches/3.0/wp-admin/includes/file.php at r16367
- File:
-
- 1 edited
-
branches/3.0/wp-admin/includes/file.php (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/wp-admin/includes/file.php
r17200 r16367 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' ),15 14 'rtl.css' => __( 'RTL Stylesheet' ), 16 15 'comments.php' => __( 'Comments' ), … … 38 37 '.htaccess' => __( '.htaccess (for rewrite rules )' ), 39 38 // Deprecated files 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 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 55 48 */ 56 49 function get_file_description( $file ) { … … 63 56 $template_data = implode( '', file( $file ) ); 64 57 if ( preg_match( '|Template Name:(.*)$|mi', $template_data, $name )) 65 return sprintf( __( '%s Page Template' ), _cleanup_header_comment($name[1]) );58 return _cleanup_header_comment($name[1]) . ' Page Template'; 66 59 } 67 60 … … 70 63 71 64 /** 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 65 * {@internal Missing Short Description}} 66 * 67 * @since unknown 68 * 69 * @return unknown 78 70 */ 79 71 function get_home_path() { … … 93 85 94 86 /** 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 87 * {@internal Missing Short Description}} 88 * 89 * @since unknown 90 * 91 * @param unknown_type $file 92 * @return unknown 107 93 */ 108 94 function get_real_file_to_edit( $file ) { … … 216 202 217 203 /** 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 204 * {@internal Missing Short Description}} 205 * 206 * @since unknown 207 * 208 * @param unknown_type $file 209 * @param unknown_type $allowed_files 210 * @return unknown 229 211 */ 230 212 function validate_file_to_edit( $file, $allowed_files = '' ) { … … 247 229 248 230 /** 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 231 * {@internal Missing Short Description}} 232 * 233 * @since unknown 234 * 262 235 * @param array $file Reference to a single element of $_FILES. Call the function once for each uploaded file. 263 236 * @param array $overrides Optional. An associative array of names=>values to override default variables with extract( $overrides, EXTR_OVERWRITE ). … … 343 316 344 317 if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) ) 345 return call_user_func($upload_error_handler, $file, __( ' Sorry, this file type is not permitted for security reasons.' ));318 return call_user_func($upload_error_handler, $file, __( 'File type does not meet security guidelines. Try another.' )); 346 319 347 320 if ( !$ext ) … … 380 353 381 354 /** 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 ). 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 397 364 */ 398 365 function wp_handle_sideload( &$file, $overrides = false ) { … … 463 430 464 431 if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) ) 465 return $upload_error_handler( $file, __( ' Sorry, this file type is not permitted for security reasons.' ));432 return $upload_error_handler( $file, __( 'File type does not meet security guidelines. Try another.' )); 466 433 467 434 if ( !$ext ) … … 508 475 * 509 476 * @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 seconds511 477 * @return mixed WP_Error on failure, string Filename on success. 512 478 */ 513 function download_url( $url , $timeout = 300) {479 function download_url( $url ) { 514 480 //WARNING: The file is not automatically deleted, The script must unlink() the file. 515 481 if ( ! $url ) … … 524 490 return new WP_Error('http_no_file', __('Could not create Temporary file.')); 525 491 526 $response = wp_remote_get($url, array('timeout' => $timeout));492 $response = wp_remote_get($url, array('timeout' => 300)); 527 493 528 494 if ( is_wp_error($response) ) { … … 971 937 $error_string = __('<strong>Error:</strong> There was an error connecting to the server, Please verify the settings are correct.'); 972 938 if ( is_wp_error($error) ) 973 $error_string = esc_html( $error->get_error_message());974 echo '<div id="message" class="error"><p>' . $error_string. '</p></div>';939 $error_string = $error->get_error_message(); 940 echo '<div id="message" class="error"><p>' . esc_html( $error_string ) . '</p></div>'; 975 941 } 976 942 … … 1006 972 $label_user = __('Username'); 1007 973 $label_pass = __('Password'); 1008 _e('To perform the requested action, WordPress needs to access your web server.');974 _e('To perform the requested action, WordPress needs to access to your web server.'); 1009 975 echo ' '; 1010 976 if ( ( isset( $types['ftp'] ) || isset( $types['ftps'] ) ) ) { … … 1072 1038 echo '<input type="hidden" name="' . esc_attr( $field ) . '" value="' . esc_attr( stripslashes( $_POST[ $field ] ) ) . '" />'; 1073 1039 } 1074 submit_button( __( 'Proceed' ), 'button', 'upgrade' );1075 1040 ?> 1041 <p class="submit"> 1042 <input id="upgrade" name="upgrade" type="submit" class="button" value="<?php esc_attr_e('Proceed'); ?>" /> 1043 </p> 1076 1044 </div> 1077 1045 </form>
Note: See TracChangeset
for help on using the changeset viewer.