mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-05-22 20:24:36 +00:00
Media: when calling pathinfo(), also pass a PATHINFO_* constant to avoid array notices for unset keys.
Props JaworskiMatt. Fixes #37608. git-svn-id: https://develop.svn.wordpress.org/trunk@38294 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -284,13 +284,12 @@ function media_handle_upload($file_id, $post_id, $post_data = array(), $override
|
||||
if ( isset($file['error']) )
|
||||
return new WP_Error( 'upload_error', $file['error'] );
|
||||
|
||||
$name_parts = pathinfo($name);
|
||||
$name = trim( substr( $name, 0, -(1 + strlen($name_parts['extension'])) ) );
|
||||
$basename = pathinfo( $name, PATHINFO_BASENAME );
|
||||
|
||||
$url = $file['url'];
|
||||
$type = $file['type'];
|
||||
$file = $file['file'];
|
||||
$title = $name;
|
||||
$title = $basename;
|
||||
$content = '';
|
||||
$excerpt = '';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user