Make WordPress Core


Ignore:
Timestamp:
05/15/2014 06:21:51 AM (12 years ago)
Author:
wonderboymusic
Message:

Eliminate the use of extract() in wp_check_filetype_and_ext().

See #22400.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r28372 r28426  
    19881988        // Do basic extension validation and MIME mapping
    19891989        $wp_filetype = wp_check_filetype( $filename, $mimes );
    1990         extract( $wp_filetype );
     1990        $ext = $wp_filetype['ext'];
     1991        $type = $wp_filetype['type'];
    19911992
    19921993        // We can't do any further validation without a file to work with
    1993         if ( ! file_exists( $file ) )
     1994        if ( ! file_exists( $file ) ) {
    19941995                return compact( 'ext', 'type', 'proper_filename' );
     1996        }
    19951997
    19961998        // We're able to validate images using GD
     
    20242026                                $new_filename = implode( '.', $filename_parts );
    20252027
    2026                                 if ( $new_filename != $filename )
     2028                                if ( $new_filename != $filename ) {
    20272029                                        $proper_filename = $new_filename; // Mark that it changed
    2028 
     2030                                }
    20292031                                // Redefine the extension / MIME
    20302032                                $wp_filetype = wp_check_filetype( $new_filename, $mimes );
    2031                                 extract( $wp_filetype );
     2033                                $ext = $wp_filetype['ext'];
     2034                                $type = $wp_filetype['type'];
    20322035                        }
    20332036                }
Note: See TracChangeset for help on using the changeset viewer.