Make WordPress Core

Ticket #45438: 45438.diff

File 45438.diff, 1012 bytes (added by peterwilsoncc, 3 years ago)
  • src/wp-admin/options.php

    diff --git a/src/wp-admin/options.php b/src/wp-admin/options.php
    index 84ac775fd4..d63b10eb4f 100644
    a b if ( 'update' === $action ) { // We are saving settings sent from a settings pag 
    255255                if ( is_multisite() && ! current_user_can( 'manage_network_options' ) ) {
    256256                        wp_die( __( 'Sorry, you are not allowed to modify unregistered settings for this site.' ) );
    257257                }
    258                 $options = explode( ',', wp_unslash( $_POST['page_options'] ) );
     258                $options = isset( $_POST['page_options'] ) ? explode( ',', wp_unslash( $_POST['page_options'] ) ) : null;
    259259        } else {
    260260                $options = $allowed_options[ $option_page ];
    261261        }
    if ( 'update' === $action ) { // We are saving settings sent from a settings pag 
    332332                if ( $user_language_old !== $user_language_new ) {
    333333                        load_default_textdomain( $user_language_new );
    334334                }
     335        } else {
     336                add_settings_error( 'general', 'settings_updated', __( 'Settings save failed.' ), 'error' );
    335337        }
    336338
    337339        /*