Make WordPress Core


Ignore:
Timestamp:
06/27/2011 03:56:42 PM (14 years ago)
Author:
ryan
Message:

Hardening. Santizers for WPLANG and new_admin_email. Prevent stomping ID and filter. Validate locale filename. Props westi.

File:
1 edited

Legend:

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

    r18324 r18346  
    24272427            }
    24282428            break;
    2429 
     2429        case 'new_admin_email':
     2430            $value = sanitize_email($value);
     2431            if ( !is_email($value) ) {
     2432                $value = get_option( $option ); // Resets option to stored value in the case of failed sanitization
     2433                if ( function_exists('add_settings_error') )
     2434                    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.'));
     2435            }
     2436            break;
    24302437        case 'thumbnail_size_w':
    24312438        case 'thumbnail_size_h':
     
    25212528            }
    25222529            break;
     2530        case 'WPLANG':
     2531            $allowed = get_available_languages();
     2532            if ( ! in_array( $value, $allowed ) && ! empty( $value ) )
     2533                $value = get_option( $option );
     2534            break;
    25232535
    25242536        case 'timezone_string':
Note: See TracChangeset for help on using the changeset viewer.