[wp-cvs] wordpress/wp-includes functions.php,1.126,1.127
Ryan Boren
rboren at users.sourceforge.net
Thu Jun 24 01:00:34 UTC 2004
Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17556
Modified Files:
functions.php
Log Message:
If the new value and old value are the same, do not update the option in update_option().
Index: functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions.php,v
retrieving revision 1.126
retrieving revision 1.127
diff -C2 -d -r1.126 -r1.127
*** functions.php 20 Jun 2004 22:36:45 -0000 1.126
--- functions.php 24 Jun 2004 01:00:31 -0000 1.127
***************
*** 321,324 ****
--- 321,330 ----
$newvalue = $newvalue;
$newvalue = trim($newvalue); // I can't think of any situation we wouldn't want to trim
+
+ // If the new and old values are the same, no need to update.
+ if ($newvalue == get_settings($option_name)) {
+ return true;
+ }
+
$newvalue = $wpdb->escape($newvalue);
$wpdb->query("UPDATE $wpdb->options SET option_value = '$newvalue' WHERE option_name = '$option_name'");
More information about the cvs
mailing list