Make WordPress Core


Ignore:
Timestamp:
06/27/2011 09:36:48 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. For 3.1.

Location:
branches/3.1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.1

  • branches/3.1/wp-includes/formatting.php

    r18353 r18356  
    24412441            }
    24422442            break;
    2443 
     2443        case 'new_admin_email':
     2444            $value = sanitize_email($value);
     2445            if ( !is_email($value) ) {
     2446                $value = get_option( $option ); // Resets option to stored value in the case of failed sanitization
     2447                if ( function_exists('add_settings_error') )
     2448                    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.'));
     2449            }
     2450            break;
    24442451        case 'thumbnail_size_w':
    24452452        case 'thumbnail_size_h':
     
    25352542            }
    25362543            break;
     2544        case 'WPLANG':
     2545            $allowed = get_available_languages();
     2546            if ( ! in_array( $value, $allowed ) && ! empty( $value ) )
     2547                $value = get_option( $option );
     2548            break;
    25372549
    25382550        default :
Note: See TracChangeset for help on using the changeset viewer.