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:
parent
abc830ca9d
commit
5c2d25aa77
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue