Make WordPress Core

Changeset 19933


Ignore:
Timestamp:
02/16/2012 03:42:02 PM (14 years ago)
Author:
nacin
Message:

Combine two identical case statements.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/formatting.php

    r19907 r19933  
    26212621
    26222622        switch ( $option ) {
    2623                 case 'admin_email':
    2624                         $value = sanitize_email($value);
    2625                         if ( !is_email($value) ) {
     2623                case 'admin_email' :
     2624                case 'new_admin_email' :
     2625                        $value = sanitize_email( $value );
     2626                        if ( ! is_email( $value ) ) {
    26262627                                $value = get_option( $option ); // Resets option to stored value in the case of failed sanitization
    2627                                 if ( function_exists('add_settings_error') )
    2628                                         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.'));
    2629                         }
    2630                         break;
    2631 
    2632                 case 'new_admin_email':
    2633                         $value = sanitize_email($value);
    2634                         if ( !is_email($value) ) {
    2635                                 $value = get_option( $option ); // Resets option to stored value in the case of failed sanitization
    2636                                 if ( function_exists('add_settings_error') )
    2637                                         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.'));
     2628                                if ( function_exists( 'add_settings_error' ) )
     2629                                        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.' ) );
    26382630                        }
    26392631                        break;
Note: See TracChangeset for help on using the changeset viewer.