mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-03 12:14:25 +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:
@@ -346,12 +346,8 @@ abstract class WP_Image_Editor {
|
||||
}
|
||||
|
||||
if ( $filename ) {
|
||||
$ext = '';
|
||||
$info = pathinfo( $filename );
|
||||
$dir = $info['dirname'];
|
||||
|
||||
if ( isset( $info['extension'] ) )
|
||||
$ext = $info['extension'];
|
||||
$dir = pathinfo( $filename, PATHINFO_DIRNAME );
|
||||
$ext = pathinfo( $filename, PATHINFO_EXTENSION );
|
||||
|
||||
$filename = trailingslashit( $dir ) . wp_basename( $filename, ".$ext" ) . ".{$new_ext}";
|
||||
}
|
||||
@@ -375,9 +371,8 @@ abstract class WP_Image_Editor {
|
||||
if ( ! $suffix )
|
||||
$suffix = $this->get_suffix();
|
||||
|
||||
$info = pathinfo( $this->file );
|
||||
$dir = $info['dirname'];
|
||||
$ext = $info['extension'];
|
||||
$dir = pathinfo( $this->file, PATHINFO_DIRNAME );
|
||||
$ext = pathinfo( $this->file, PATHINFO_EXTENSION );
|
||||
|
||||
$name = wp_basename( $this->file, ".$ext" );
|
||||
$new_ext = strtolower( $extension ? $extension : $ext );
|
||||
|
||||
Reference in New Issue
Block a user