Filter out empty and duplicate values in Comment Moderation and Comment Blacklist settings.

props GaVrA.
fixes #23800.

git-svn-id: https://develop.svn.wordpress.org/trunk@28444 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2014-05-16 11:09:28 +00:00
parent 6100833f0c
commit 4585195977
1 changed files with 8 additions and 0 deletions

View File

@ -3289,6 +3289,14 @@ function sanitize_option($option, $value) {
if ( ! get_role( $value ) && get_role( 'subscriber' ) )
$value = 'subscriber';
break;
case 'moderation_keys':
case 'blacklist_keys':
$value = explode( "\n", $value );
$value = array_filter( array_map( 'trim', $value ) );
$value = array_unique( $value );
$value = implode( "\n", $value );
break;
}
/**