File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -368,7 +368,7 @@ public static function getTotal(): int {
368368 }
369369
370370 /**
371- * @return mixed [] redirects
371+ * @return object [] redirects
372372 */
373373 public static function listRedirects (): array {
374374 global $ wpdb ;
@@ -379,14 +379,6 @@ public static function listRedirects(): array {
379379 "SELECT path, redirect_to FROM $ table_name WHERE 0 < LENGTH(redirect_to) "
380380 );
381381
382- $ redirs = [];
383- foreach ( $ rows as $ row ) {
384- $ redirs [ $ row ->path ] = [
385- 'url ' => $ row ->path ,
386- 'redirect_to ' => $ row ->redirect_to ,
387- ];
388- }
389-
390- return $ redirs ;
382+ return $ rows ;
391383 }
392384}
Original file line number Diff line number Diff line change @@ -90,15 +90,15 @@ public function uploadFiles( string $processed_site_path ): void {
9090 }
9191
9292 foreach ( $ redirects as $ redirect ) {
93- $ path = $ redirect[ ' url ' ] ;
93+ $ path = $ redirect-> path ;
9494
9595 if ( mb_substr ( $ path , -1 ) === '/ ' ) {
9696 $ path = $ path . 'index.html ' ;
9797 }
9898
9999 yield [
100100 'path ' => $ path ,
101- 'redirect_to ' => $ redirect[ ' redirect_to ' ] ,
101+ 'redirect_to ' => $ redirect-> redirect_to ,
102102 ];
103103 }
104104 };
You can’t perform that action at this time.
0 commit comments