Make WordPress Core

Changeset 1446


Ignore:
Timestamp:
06/24/2004 01:00:31 AM (22 years ago)
Author:
rboren
Message:

If the new value and old value are the same, do not update the option in update_option().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r1443 r1446  
    321321    $newvalue = $newvalue;
    322322    $newvalue = trim($newvalue); // I can't think of any situation we wouldn't want to trim
     323
     324    // If the new and old values are the same, no need to update.
     325    if ($newvalue == get_settings($option_name)) {
     326        return true;
     327    }
     328
    323329    $newvalue = $wpdb->escape($newvalue);
    324330    $wpdb->query("UPDATE $wpdb->options SET option_value = '$newvalue' WHERE option_name = '$option_name'");
Note: See TracChangeset for help on using the changeset viewer.