Fixed bug that caused empty string options to receive a '0' value on update. This was breaking fileupload_allowedusers, for example.

git-svn-id: http://svn.automattic.com/wordpress/trunk@978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
emc3 2004-03-16 17:36:56 +00:00
parent d71f97bb20
commit 16e6fd76ea

View File

@ -74,7 +74,12 @@ $nonbools = array('default_ping_status', 'default_comment_status');
if ($user_level >= $option->option_admin_level) {
$old_val = stripslashes($option->option_value);
$new_val = $_POST[$option->option_name];
if (!$new_val) $new_val = 0;
if (!$new_val) {
if (3 == $option->option_type)
$new_val = '';
else
$new_val = 0;
}
if( in_array($option->option_name, $nonbools) && $new_val == 0 ) $new_value = 'closed';
if ($new_val !== $old_val) {
$query = "UPDATE $tableoptions SET option_value = '$new_val' WHERE option_id = $option->option_id";