@@ -820,15 +820,15 @@ public function step_2() {
820820 return $ this ->finished ();
821821 } elseif ( $ width > $ max_width ) {
822822 $ oitar = $ width / $ max_width ;
823- $ image = wp_crop_image ( $ attachment_id , 0 , 0 , $ width , $ height , $ max_width , $ height / $ oitar , false , str_replace ( basename ( $ file ), 'midsize- ' . basename ( $ file ), $ file ) );
823+ $ image = wp_crop_image ( $ attachment_id , 0 , 0 , $ width , $ height , $ max_width , $ height / $ oitar , false , str_replace ( wp_basename ( $ file ), 'midsize- ' . wp_basename ( $ file ), $ file ) );
824824 if ( ! $ image || is_wp_error ( $ image ) ) {
825825 wp_die ( __ ( 'Image could not be processed. Please go back and try again. ' ), __ ( 'Image Processing Error ' ) );
826826 }
827827
828828 /** This filter is documented in wp-admin/custom-header.php */
829829 $ image = apply_filters ( 'wp_create_file_in_uploads ' , $ image , $ attachment_id ); // For replication
830830
831- $ url = str_replace ( basename ( $ url ), basename ( $ image ), $ url );
831+ $ url = str_replace ( wp_basename ( $ url ), wp_basename ( $ image ), $ url );
832832 $ width = $ width / $ oitar ;
833833 $ height = $ height / $ oitar ;
834834 } else {
@@ -895,7 +895,7 @@ public function step_2_manage_upload() {
895895 $ url = $ file ['url ' ];
896896 $ type = $ file ['type ' ];
897897 $ file = $ file ['file ' ];
898- $ filename = basename ( $ file );
898+ $ filename = wp_basename ( $ file );
899899
900900 // Construct the object array
901901 $ object = array (
@@ -984,7 +984,7 @@ public function step_3() {
984984 $ this ->set_header_image ( compact ( 'url ' , 'attachment_id ' , 'width ' , 'height ' ) );
985985
986986 // Cleanup.
987- $ medium = str_replace ( basename ( $ original ), 'midsize- ' . basename ( $ original ), $ original );
987+ $ medium = str_replace ( wp_basename ( $ original ), 'midsize- ' . wp_basename ( $ original ), $ original );
988988 if ( file_exists ( $ medium ) ) {
989989 wp_delete_file ( $ medium );
990990 }
@@ -1208,14 +1208,14 @@ final public function get_header_dimensions( $dimensions ) {
12081208 final public function create_attachment_object ( $ cropped , $ parent_attachment_id ) {
12091209 $ parent = get_post ( $ parent_attachment_id );
12101210 $ parent_url = wp_get_attachment_url ( $ parent ->ID );
1211- $ url = str_replace ( basename ( $ parent_url ), basename ( $ cropped ), $ parent_url );
1211+ $ url = str_replace ( wp_basename ( $ parent_url ), wp_basename ( $ cropped ), $ parent_url );
12121212
12131213 $ size = @getimagesize ( $ cropped );
12141214 $ image_type = ( $ size ) ? $ size ['mime ' ] : 'image/jpeg ' ;
12151215
12161216 $ object = array (
12171217 'ID ' => $ parent_attachment_id ,
1218- 'post_title ' => basename ( $ cropped ),
1218+ 'post_title ' => wp_basename ( $ cropped ),
12191219 'post_mime_type ' => $ image_type ,
12201220 'guid ' => $ url ,
12211221 'context ' => 'custom-header ' ,
0 commit comments