mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-13 22:26:06 +01:00
Combine two identical case statements.
git-svn-id: http://svn.automattic.com/wordpress/trunk@19933 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
72791ea930
commit
8961a61f89
@ -2621,20 +2621,12 @@ function sanitize_option($option, $value) {
|
|||||||
|
|
||||||
switch ( $option ) {
|
switch ( $option ) {
|
||||||
case 'admin_email' :
|
case 'admin_email' :
|
||||||
$value = sanitize_email($value);
|
|
||||||
if ( !is_email($value) ) {
|
|
||||||
$value = get_option( $option ); // Resets option to stored value in the case of failed sanitization
|
|
||||||
if ( function_exists('add_settings_error') )
|
|
||||||
add_settings_error('admin_email', 'invalid_admin_email', __('The email address entered did not appear to be a valid email address. Please enter a valid email address.'));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'new_admin_email' :
|
case 'new_admin_email' :
|
||||||
$value = sanitize_email( $value );
|
$value = sanitize_email( $value );
|
||||||
if ( ! is_email( $value ) ) {
|
if ( ! is_email( $value ) ) {
|
||||||
$value = get_option( $option ); // Resets option to stored value in the case of failed sanitization
|
$value = get_option( $option ); // Resets option to stored value in the case of failed sanitization
|
||||||
if ( function_exists( 'add_settings_error' ) )
|
if ( function_exists( 'add_settings_error' ) )
|
||||||
add_settings_error('new_admin_email', 'invalid_admin_email', __('The email address entered did not appear to be a valid email address. Please enter a valid email address.'));
|
add_settings_error( $option, 'invalid_admin_email', __( 'The email address entered did not appear to be a valid email address. Please enter a valid email address.' ) );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user