Make WordPress Core


Ignore:
Timestamp:
01/03/2022 09:26:48 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison in wp-admin/options.php.

Follow-up to [21852], [47874], [51075].

See #53359.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/options.php

    r51475 r52431  
    5858    $new_admin_details = get_option( 'adminhash' );
    5959    $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'] ) ) {
     60
     61    if ( is_array( $new_admin_details )
     62        && hash_equals( $new_admin_details['hash'], $_GET['adminhash'] )
     63        && ! empty( $new_admin_details['newemail'] )
     64    ) {
    6165        update_option( 'admin_email', $new_admin_details['newemail'] );
    6266        delete_option( 'adminhash' );
     
    6468        $redirect = 'options-general.php?updated=true';
    6569    }
     70
    6671    wp_redirect( admin_url( $redirect ) );
    6772    exit;
     
    7479}
    7580
    76 if ( is_multisite() && ! current_user_can( 'manage_network_options' ) && 'update' != $action ) {
     81if ( is_multisite() && ! current_user_can( 'manage_network_options' ) && 'update' !== $action ) {
    7782    wp_die(
    7883        '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
     
    184189     * they can be edited, otherwise they're locked.
    185190     */
    186     if ( get_option( 'upload_url_path' ) || ( get_option( 'upload_path' ) != 'wp-content/uploads' && get_option( 'upload_path' ) ) ) {
     191    if ( get_option( 'upload_url_path' )
     192        || get_option( 'upload_path' ) && 'wp-content/uploads' !== get_option( 'upload_path' )
     193    ) {
    187194        $allowed_options['media'][] = 'upload_path';
    188195        $allowed_options['media'][] = 'upload_url_path';
Note: See TracChangeset for help on using the changeset viewer.