From fffefba32c875a8f92ec6408ec06974f4f66ead3 Mon Sep 17 00:00:00 2001 From: Dougal Campbell Date: Tue, 16 Mar 2004 17:36:56 +0000 Subject: [PATCH] Fixed bug that caused empty string options to receive a '0' value on update. This was breaking fileupload_allowedusers, for example. git-svn-id: https://develop.svn.wordpress.org/trunk@978 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/options.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-admin/options.php b/wp-admin/options.php index b0f7f0f66a..f26e509ce4 100644 --- a/wp-admin/options.php +++ b/wp-admin/options.php @@ -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";