Make WordPress Core


Ignore:
Timestamp:
04/21/2006 05:00:58 AM (20 years ago)
Author:
ryan
Message:

Make sure we have links to iterate over. fixes #2675

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/upgrade-functions.php

    r3692 r3734  
    523523                // Associate links to cats.
    524524                $links = $wpdb->get_results("SELECT link_id, link_category FROM $wpdb->links");
    525                 foreach ( $links as $link ) {
     525                if ( !empty($links) ) foreach ( $links as $link ) {
    526526                        $link_cat = $link_cat_id_map[$link->link_category];
    527527                        $cat = $wpdb->get_row("SELECT * FROM $wpdb->link2cat WHERE link_id = '$link->link_id' AND category_id = '$link_cat'");
Note: See TracChangeset for help on using the changeset viewer.