mirror of
git://develop.git.wordpress.org/
synced 2025-03-21 20:40:44 +01:00
Coding Standards: Use strict comparison in wp-admin/options.php
.
Follow-up to [21852], [47874], [51075]. See #53359. git-svn-id: https://develop.svn.wordpress.org/trunk@52431 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
57189ab42d
commit
f80d2c6240
@ -57,12 +57,17 @@ if ( ! current_user_can( $capability ) ) {
|
||||
if ( ! empty( $_GET['adminhash'] ) ) {
|
||||
$new_admin_details = get_option( 'adminhash' );
|
||||
$redirect = 'options-general.php?updated=false';
|
||||
if ( is_array( $new_admin_details ) && hash_equals( $new_admin_details['hash'], $_GET['adminhash'] ) && ! empty( $new_admin_details['newemail'] ) ) {
|
||||
|
||||
if ( is_array( $new_admin_details )
|
||||
&& hash_equals( $new_admin_details['hash'], $_GET['adminhash'] )
|
||||
&& ! empty( $new_admin_details['newemail'] )
|
||||
) {
|
||||
update_option( 'admin_email', $new_admin_details['newemail'] );
|
||||
delete_option( 'adminhash' );
|
||||
delete_option( 'new_admin_email' );
|
||||
$redirect = 'options-general.php?updated=true';
|
||||
}
|
||||
|
||||
wp_redirect( admin_url( $redirect ) );
|
||||
exit;
|
||||
} elseif ( ! empty( $_GET['dismiss'] ) && 'new_admin_email' === $_GET['dismiss'] ) {
|
||||
@ -73,7 +78,7 @@ if ( ! empty( $_GET['adminhash'] ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( is_multisite() && ! current_user_can( 'manage_network_options' ) && 'update' != $action ) {
|
||||
if ( is_multisite() && ! current_user_can( 'manage_network_options' ) && 'update' !== $action ) {
|
||||
wp_die(
|
||||
'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
|
||||
'<p>' . __( 'Sorry, you are not allowed to delete these items.' ) . '</p>',
|
||||
@ -183,7 +188,9 @@ if ( ! is_multisite() ) {
|
||||
* or upload_path is not the default ('wp-content/uploads' or empty),
|
||||
* they can be edited, otherwise they're locked.
|
||||
*/
|
||||
if ( get_option( 'upload_url_path' ) || ( get_option( 'upload_path' ) != 'wp-content/uploads' && get_option( 'upload_path' ) ) ) {
|
||||
if ( get_option( 'upload_url_path' )
|
||||
|| get_option( 'upload_path' ) && 'wp-content/uploads' !== get_option( 'upload_path' )
|
||||
) {
|
||||
$allowed_options['media'][] = 'upload_path';
|
||||
$allowed_options['media'][] = 'upload_url_path';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user