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

props GaVrA.
fixes #23800.
Built from https://develop.svn.wordpress.org/trunk@28444


git-svn-id: http://core.svn.wordpress.org/trunk@28271 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2014-05-16 11:10:14 +00:00
parent abc830ca9d
commit 5c2d25aa77
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' ) ) if ( ! get_role( $value ) && get_role( 'subscriber' ) )
$value = 'subscriber'; $value = 'subscriber';
break; 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;
} }
/** /**