mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-10 18:37:58 +01:00
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:
parent
d71f97bb20
commit
16e6fd76ea
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user