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

git-svn-id: https://develop.svn.wordpress.org/trunk@3734 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2006-04-21 05:00:58 +00:00
parent d58cfe86e0
commit 9c103c8d64
1 changed files with 1 additions and 1 deletions

View File

@ -522,7 +522,7 @@ function upgrade_210() {
// Associate links to cats.
$links = $wpdb->get_results("SELECT link_id, link_category FROM $wpdb->links");
foreach ( $links as $link ) {
if ( !empty($links) ) foreach ( $links as $link ) {
$link_cat = $link_cat_id_map[$link->link_category];
$cat = $wpdb->get_row("SELECT * FROM $wpdb->link2cat WHERE link_id = '$link->link_id' AND category_id = '$link_cat'");
if (!$cat && 0 != $link->link_category) {