WordPress.org

Make WordPress Core

Ticket #6836: 6836.2.diff

File 6836.2.diff, 2.3 KB (added by DD32, 7 years ago)

changes tested.

  • wp-admin/includes/bookmark.php

     
    119119        } 
    120120 
    121121        if ( $update ) { 
    122                 $wpdb->query( $wpdb->prepare("UPDATE $wpdb->links SET link_url = %s, 
    123                         link_name = %s, link_image = %s, link_target = %s,  
    124                         link_visible = %s, link_description = %s, link_rating = %s,  
    125                         link_rel = %s, link_notes = %s, link_rss = %s 
    126                         WHERE link_id = %s", $link_url, $link_name, $link_image, $link_target, $link_visible, $link_description, $link_rating, $link_rel, $link_notes, $link_rss, $link_id) ); 
     122                $wpdb->update( $wpdb->links, compact('link_url', 'link_name', 'link_image', 'link_target', 'link_description', 'link_visible', 'link_rating', 'link_rel', 'link_notes', 'link_rss'), compact('link_id') ); 
    127123        } else { 
    128                 $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->links (link_url, link_name, link_image, link_target, link_description, link_visible, link_owner, link_rating, link_rel, link_notes, link_rss) VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",  
    129                 $link_url,$link_name, $link_image, $link_target, $link_description, $link_visible, $link_owner, $link_rating, $link_rel, $link_notes, $link_rss) ); 
     124                $wpdb->insert( $wpdb->links, compact('link_url', 'link_name', 'link_image', 'link_target', 'link_description', 'link_visible', 'link_owner', 'link_rating', 'link_rel', 'link_notes', 'link_rss') ); 
    130125                $link_id = (int) $wpdb->insert_id; 
    131126        } 
    132127 
  • wp-admin/includes/user.php

     
    258258                $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->links WHERE link_owner = %d", $id) ); 
    259259        } else { 
    260260                $reassign = (int) $reassign; 
    261                 $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_author = %d WHERE post_author = %d", $reassign, $id) ); 
    262                 $wpdb->query( $wpdb->prepare("UPDATE $wpdb->links SET link_owner = %d WHERE link_owner = %d}", $reassign, $id) ); 
     261                $wpdb->update( $wpdb->posts, array('post_author' => $reassign), array('post_author' => $id) ); 
     262                $wpdb->update( $wpdb->links, array('link_owner' => $reassign), array('link_owner' => $id) ); 
    263263        } 
    264264 
    265265        // FINALLY, delete user