Ticket #14783: 14783.003.diff
| File 14783.003.diff, 4.9 KB (added by sivel, 3 years ago) |
|---|
-
wp-admin/includes/file.php
39 39 'wp-layout.css' => __( 'Stylesheet' ), 'wp-comments.php' => __( 'Comments Template' ), 'wp-comments-popup.php' => __( 'Popup Comments Template' )); 40 40 41 41 /** 42 * {@internal Missing Short Description}} 42 * Get the description for standard WordPress theme files and other various standard 43 * WordPress files 43 44 * 44 * @since unknown45 * @since 1.5.0 45 46 * 46 * @param unknown_type $file 47 * @return unknown 47 * @uses _cleanup_header_comment 48 * @uses $wp_file_descriptions 49 * @param string $file Filesystem path or filename 50 * @return string Description of file from $wp_file_descriptions or basename of $file if description doesn't exist 48 51 */ 49 52 function get_file_description( $file ) { 50 53 global $wp_file_descriptions; … … 62 65 } 63 66 64 67 /** 65 * {@internal Missing Short Description}}68 * Get the absolute filesystem path to the root of the WordPress installation 66 69 * 67 * @since unknown70 * @since 1.5.0 68 71 * 69 * @return unknown 72 * @uses get_option 73 * @return string Full filesystem path to the root of the WordPress installation 70 74 */ 71 75 function get_home_path() { 72 76 $home = get_option( 'home' ); … … 84 88 } 85 89 86 90 /** 87 * {@internal Missing Short Description}}91 * Get the real file system path to a file to edit within the admin 88 92 * 89 * @since unknown 93 * If the $file is index.php or .htaccess this function will assume it is relative 94 * to the install root, otherwise it is assumed the file is relative to the wp-content 95 * directory 90 96 * 91 * @param unknown_type $file 92 * @return unknown 97 * @since 1.5.0 98 * 99 * @uses get_home_path 100 * @uses WP_CONTENT_DIR full filesystem path to the wp-content directory 101 * @param string $file filesystem path relative to the WordPress install directory or to the wp-content directory 102 * @return string full file system path to edit 93 103 */ 94 104 function get_real_file_to_edit( $file ) { 95 105 if ('index.php' == $file || '.htaccess' == $file ) { … … 201 211 } 202 212 203 213 /** 204 * {@internal Missing Short Description}}214 * Make sure that the file that was requested to edit, is allowed to be edited 205 215 * 206 * @since unknown216 * Function will die if if you are not allowed to edit the file 207 217 * 208 * @param unknown_type $file 209 * @param unknown_type $allowed_files 210 * @return unknown 218 * @since 1.5.0 219 * 220 * @uses wp_die 221 * @uses validate_file 222 * @param string $file file the users is attempting to edit 223 * @param array $allowed_files Array of allowed files to edit, $file must match an entry exactly 224 * @return null 211 225 */ 212 226 function validate_file_to_edit( $file, $allowed_files = '' ) { 213 227 $code = validate_file( $file, $allowed_files ); … … 228 242 } 229 243 230 244 /** 231 * {@internal Missing Short Description}} 245 * Handle PHP uploads in WordPress, sanitizing file names, checking extensions for mime type, 246 * and moving the file to the appropriate directory within the uploads directory. 232 247 * 233 * @since unknown248 * @since 2.0 234 249 * 250 * @uses wp_handle_upload_error 251 * @uses apply_filters 252 * @uses is_multisite 253 * @uses wp_check_filetype_and_ext 254 * @uses current_user_can 255 * @uses wp_upload_dir 256 * @uses wp_unique_filename 257 * @uses delete_transient 235 258 * @param array $file Reference to a single element of $_FILES. Call the function once for each uploaded file. 236 259 * @param array $overrides Optional. An associative array of names=>values to override default variables with extract( $overrides, EXTR_OVERWRITE ). 237 260 * @return array On success, returns an associative array of file attributes. On failure, returns $overrides['upload_error_handler'](&$file, $message ) or array( 'error'=>$message ). … … 352 375 } 353 376 354 377 /** 355 * {@internal Missing Short Description}} 378 * Handle sideloads, which is the process of retriving a media item from another server instead of 379 * a traditional media upload. This process involves sanitizing the filename, checking extensions 380 * for mime type, and moving the file to the appropriate directory within the uploads directory. 356 381 * 357 * Pass this function an array similar to that of a $_FILES POST array.382 * @since 2.6.0 358 383 * 359 * @since unknown 360 * 361 * @param unknown_type $file 362 * @param unknown_type $overrides 363 * @return unknown 384 * @uses wp_handle_upload_error 385 * @uses apply_filters 386 * @uses wp_check_filetype_and_ext 387 * @uses current_user_can 388 * @uses wp_upload_dir 389 * @uses wp_unique_filename 390 * @param array $file an array similar to that of a PHP $_FILES POST array 391 * @param array $overrides Optional. An associative array of names=>values to override default variables with extract( $overrides, EXTR_OVERWRITE ). 392 * @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 393 */ 365 394 function wp_handle_sideload( &$file, $overrides = false ) { 366 395 // The default error handler.
