Declare the variable before using it.

props danielbachhuber.
fixes #28932.
Built from https://develop.svn.wordpress.org/trunk@29215


git-svn-id: http://core.svn.wordpress.org/trunk@28999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2014-07-17 22:01:14 +00:00
parent 5c5c73b50e
commit be718ee860

View File

@ -811,6 +811,7 @@ function media_sideload_image( $file, $post_id, $desc = null ) {
if ( ! empty( $file ) ) {
// Set variables for storage, fix file filename for query strings.
preg_match( '/[^\?]+\.(jpe?g|jpe|gif|png)\b/i', $file, $matches );
$file_array = array();
$file_array['name'] = basename( $matches[0] );
// Download file to temp location.