@@ -530,7 +530,7 @@ public function import( $args, $assoc_args = array() ) {
530530 continue ;
531531 }
532532 if ( Utils \get_flag_value ( $ assoc_args , 'skip-duplicates ' ) ) {
533- $ existing = $ this ->find_duplicate_attachment ( Utils \ basename ( $ file ) );
533+ $ existing = $ this ->find_duplicate_attachment ( Path:: basename ( $ file ) );
534534 if ( false !== $ existing ) {
535535 if ( ! $ porcelain ) {
536536 WP_CLI ::log ( "Skipped importing file ' $ orig_filename'. Reason: already exists as attachment ID $ existing. " );
@@ -551,7 +551,7 @@ public function import( $args, $assoc_args = array() ) {
551551 }
552552 } else {
553553 if ( Utils \get_flag_value ( $ assoc_args , 'skip-duplicates ' ) ) {
554- $ existing = $ this ->find_duplicate_attachment ( (string ) explode ( '? ' , Utils \ basename ( $ file ), 2 )[0 ] );
554+ $ existing = $ this ->find_duplicate_attachment ( (string ) explode ( '? ' , Path:: basename ( $ file ), 2 )[0 ] );
555555 if ( false !== $ existing ) {
556556 if ( ! $ porcelain ) {
557557 WP_CLI ::log ( "Skipped importing file ' $ orig_filename'. Reason: already exists as attachment ID $ existing. " );
@@ -572,7 +572,7 @@ public function import( $args, $assoc_args = array() ) {
572572 ++$ errors ;
573573 continue ;
574574 }
575- $ name = (string ) explode ( '? ' , Path::basename ( $ file ), 2 )[0 ];
575+ $ name = (string ) explode ( '? ' , Path::basename ( $ file ), 2 )[0 ];
576576 }
577577
578578 if ( ! empty ( $ assoc_args ['file_name ' ] ) ) {
0 commit comments