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:
parent
5c5c73b50e
commit
be718ee860
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue