Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/file.php

    r16367 r17200  
    88
    99/** The descriptions for theme files. */
    10 $wp_file_descriptions = array (
     10$wp_file_descriptions = array(
    1111    'index.php' => __( 'Main Index Template' ),
    1212    'style.css' => __( 'Stylesheet' ),
    1313    'editor-style.css' => __( 'Visual Editor Stylesheet' ),
     14    'editor-style-rtl.css' => __( 'Visual Editor RTL Stylesheet' ),
    1415    'rtl.css' => __( 'RTL Stylesheet' ),
    1516    'comments.php' => __( 'Comments' ),
     
    3738    '.htaccess' => __( '.htaccess (for rewrite rules )' ),
    3839    // 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
    4855 */
    4956function get_file_description( $file ) {
     
    5663        $template_data = implode( '', file( $file ) );
    5764        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]) );
    5966    }
    6067
     
    6370
    6471/**
    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
    7078 */
    7179function get_home_path() {
     
    8593
    8694/**
    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
    93107 */
    94108function get_real_file_to_edit( $file ) {
     
    202216
    203217/**
    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
    211229 */
    212230function validate_file_to_edit( $file, $allowed_files = '' ) {
     
    229247
    230248/**
    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
    235262 * @param array $file Reference to a single element of $_FILES. Call the function once for each uploaded file.
    236263 * @param array $overrides Optional. An associative array of names=>values to override default variables with extract( $overrides, EXTR_OVERWRITE ).
     
    316343
    317344        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.' ));
    319346
    320347        if ( !$ext )
     
    353380
    354381/**
    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 ).
    364397 */
    365398function wp_handle_sideload( &$file, $overrides = false ) {
     
    430463
    431464        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.' ));
    433466
    434467        if ( !$ext )
     
    475508 *
    476509 * @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
    477511 * @return mixed WP_Error on failure, string Filename on success.
    478512 */
    479 function download_url( $url ) {
     513function download_url( $url, $timeout = 300 ) {
    480514    //WARNING: The file is not automatically deleted, The script must unlink() the file.
    481515    if ( ! $url )
     
    490524        return new WP_Error('http_no_file', __('Could not create Temporary file.'));
    491525
    492     $response = wp_remote_get($url, array('timeout' => 300));
     526    $response = wp_remote_get($url, array('timeout' => $timeout));
    493527
    494528    if ( is_wp_error($response) ) {
     
    937971        $error_string = __('<strong>Error:</strong> There was an error connecting to the server, Please verify the settings are correct.');
    938972        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>';
    941975    }
    942976
     
    9721006    $label_user = __('Username');
    9731007    $label_pass = __('Password');
    974     _e('To perform the requested action, WordPress needs to access to your web server.');
     1008    _e('To perform the requested action, WordPress needs to access your web server.');
    9751009    echo ' ';
    9761010    if ( ( isset( $types['ftp'] ) || isset( $types['ftps'] ) ) ) {
     
    10381072        echo '<input type="hidden" name="' . esc_attr( $field ) . '" value="' . esc_attr( stripslashes( $_POST[ $field ] ) ) . '" />';
    10391073}
     1074submit_button( __( 'Proceed' ), 'button', 'upgrade' );
    10401075?>
    1041 <p class="submit">
    1042 <input id="upgrade" name="upgrade" type="submit" class="button" value="<?php esc_attr_e('Proceed'); ?>" />
    1043 </p>
    10441076</div>
    10451077</form>
Note: See TracChangeset for help on using the changeset viewer.