WordPress.org

Make WordPress Core

Changeset 13053


Ignore:
Timestamp:
02/11/2010 04:17:12 PM (11 years ago)
Author:
ryan
Message:

Test explicitly for false from insert()/update(). Fixes early return that preventing link categories from being saved. fixes #12196

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/bookmark.php

    r12652 r13053  
    187187
    188188    if ( $update ) {
    189         if ( ! $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') ) ) {
     189        if ( false === $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') ) ) {
    190190            if ( $wp_error )
    191191                return new WP_Error( 'db_update_error', __( 'Could not update link in the database' ), $wpdb->last_error );
     
    194194        }
    195195    } else {
    196         if ( ! $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') ) ) {
     196        if ( false === $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') ) ) {
    197197            if ( $wp_error )
    198198                return new WP_Error( 'db_insert_error', __( 'Could not insert link into the database' ), $wpdb->last_error );
Note: See TracChangeset for help on using the changeset viewer.