]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/class-wp-image-editor.php
WordPress 4.7-scripts
[autoinstalls/wordpress.git] / wp-includes / class-wp-image-editor.php
index c046823e9fc73652da7bd298f9b05f019723d622..cc991eb8a9cb9e059a20728c31fc476944b18161 100644 (file)
@@ -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 );