Changeset 41254 for trunk/src/wp-admin/options.php
- Timestamp:
- 08/14/2017 08:12:23 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/options.php
r39933 r41254 54 54 55 55 // Handle admin email change requests 56 if ( is_multisite() ) { 57 if ( ! empty($_GET[ 'adminhash' ] ) ) { 58 $new_admin_details = get_option( 'adminhash' ); 59 $redirect = 'options-general.php?updated=false'; 60 if ( is_array( $new_admin_details ) && hash_equals( $new_admin_details[ 'hash' ], $_GET[ 'adminhash' ] ) && !empty($new_admin_details[ 'newemail' ]) ) { 61 update_option( 'admin_email', $new_admin_details[ 'newemail' ] ); 62 delete_option( 'adminhash' ); 63 delete_option( 'new_admin_email' ); 64 $redirect = 'options-general.php?updated=true'; 65 } 66 wp_redirect( admin_url( $redirect ) ); 67 exit; 68 } elseif ( ! empty( $_GET['dismiss'] ) && 'new_admin_email' == $_GET['dismiss'] ) { 69 check_admin_referer( 'dismiss-' . get_current_blog_id() . '-new_admin_email' ); 56 if ( ! empty( $_GET[ 'adminhash' ] ) ) { 57 $new_admin_details = get_option( 'adminhash' ); 58 $redirect = 'options-general.php?updated=false'; 59 if ( is_array( $new_admin_details ) && hash_equals( $new_admin_details[ 'hash' ], $_GET[ 'adminhash' ] ) && ! empty( $new_admin_details[ 'newemail' ] ) ) { 60 update_option( 'admin_email', $new_admin_details[ 'newemail' ] ); 70 61 delete_option( 'adminhash' ); 71 62 delete_option( 'new_admin_email' ); 72 wp_redirect( admin_url( 'options-general.php?updated=true' ) ); 73 exit; 74 } 63 $redirect = 'options-general.php?updated=true'; 64 } 65 wp_redirect( admin_url( $redirect ) ); 66 exit; 67 } elseif ( ! empty( $_GET['dismiss'] ) && 'new_admin_email' == $_GET['dismiss'] ) { 68 check_admin_referer( 'dismiss-' . get_current_blog_id() . '-new_admin_email' ); 69 delete_option( 'adminhash' ); 70 delete_option( 'new_admin_email' ); 71 wp_redirect( admin_url( 'options-general.php?updated=true' ) ); 72 exit; 75 73 } 76 74 … … 84 82 85 83 $whitelist_options = array( 86 'general' => array( 'blogname', 'blogdescription', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'timezone_string', 'WPLANG' ),84 'general' => array( 'blogname', 'blogdescription', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'timezone_string', 'WPLANG', 'new_admin_email' ), 87 85 'discussion' => array( 'default_pingback_flag', 'default_ping_status', 'default_comment_status', 'comments_notify', 'moderation_notify', 'comment_moderation', 'require_name_email', 'comment_whitelist', 'comment_max_links', 'moderation_keys', 'blacklist_keys', 'show_avatars', 'avatar_rating', 'avatar_default', 'close_comments_for_old_posts', 'close_comments_days_old', 'thread_comments', 'thread_comments_depth', 'page_comments', 'comments_per_page', 'default_comments_page', 'comment_order', 'comment_registration' ), 88 86 'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type' ), … … 108 106 $whitelist_options['general'][] = 'home'; 109 107 110 $whitelist_options['general'][] = 'admin_email';111 108 $whitelist_options['general'][] = 'users_can_register'; 112 109 $whitelist_options['general'][] = 'default_role'; … … 123 120 } 124 121 } else { 125 $whitelist_options['general'][] = 'new_admin_email';126 127 122 /** 128 123 * Filters whether the post-by-email functionality is enabled.
Note: See TracChangeset
for help on using the changeset viewer.