Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r17200 r16367  
    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' ),
    1514    'rtl.css' => __( 'RTL Stylesheet' ),
    1615    'comments.php' => __( 'Comments' ),
     
    3837    '.htaccess' => __( '.htaccess (for rewrite rules )' ),
    3938    // 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
    5548 */
    5649function get_file_description( $file ) {
     
    6356        $template_data = implode( '', file( $file ) );
    6457        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';
    6659    }
    6760
     
    7063
    7164/**
    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
    7870 */
    7971function get_home_path() {
     
    9385
    9486/**
    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
    10793 */
    10894function get_real_file_to_edit( $file ) {
     
    216202
    217203/**
    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
    229211 */
    230212function validate_file_to_edit( $file, $allowed_files = '' ) {
     
    247229
    248230/**
    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 *
    262235 * @param array $file Reference to a single element of $_FILES. Call the function once for each uploaded file.
    263236 * @param array $overrides Optional. An associative array of names=>values to override default variables with extract( $overrides, EXTR_OVERWRITE ).
     
    343316
    344317        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.' ));
    346319
    347320        if ( !$ext )
     
    380353
    381354/**
    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
    397364 */
    398365function wp_handle_sideload( &$file, $overrides = false ) {
     
    463430
    464431        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.' ));
    466433
    467434        if ( !$ext )
     
    508475 *
    509476 * @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
    511477 * @return mixed WP_Error on failure, string Filename on success.
    512478 */
    513 function download_url( $url, $timeout = 300 ) {
     479function download_url( $url ) {
    514480    //WARNING: The file is not automatically deleted, The script must unlink() the file.
    515481    if ( ! $url )
     
    524490        return new WP_Error('http_no_file', __('Could not create Temporary file.'));
    525491
    526     $response = wp_remote_get($url, array('timeout' => $timeout));
     492    $response = wp_remote_get($url, array('timeout' => 300));
    527493
    528494    if ( is_wp_error($response) ) {
     
    971937        $error_string = __('<strong>Error:</strong> There was an error connecting to the server, Please verify the settings are correct.');
    972938        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>';
    975941    }
    976942
     
    1006972    $label_user = __('Username');
    1007973    $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.');
    1009975    echo ' ';
    1010976    if ( ( isset( $types['ftp'] ) || isset( $types['ftps'] ) ) ) {
     
    10721038        echo '<input type="hidden" name="' . esc_attr( $field ) . '" value="' . esc_attr( stripslashes( $_POST[ $field ] ) ) . '" />';
    10731039}
    1074 submit_button( __( 'Proceed' ), 'button', 'upgrade' );
    10751040?>
     1041<p class="submit">
     1042<input id="upgrade" name="upgrade" type="submit" class="button" value="<?php esc_attr_e('Proceed'); ?>" />
     1043</p>
    10761044</div>
    10771045</form>
Note: See TracChangeset for help on using the changeset viewer.