Make WordPress Core


Ignore:
Timestamp:
07/09/2019 05:44:42 AM (6 years ago)
Author:
pento
Message:

Coding Standards: Fix instances of WordPress.PHP.NoSilencedErrors.Discouraged.

Noteable changes:

  • The magic_quotes_runtime and magic_quotes_sybase settings were removed in PHP 5.4, so no longer need to be set.
  • Some functions that use external libraries can generate errors that can't be tested for, so are globally allowed to silence errors.
  • Quite a few functions would cause errors if safe_mode was set. This setting was removed in PHP 5.4.
  • Only a handful of header() calls needed corresponding headers_sent() checks for unit tests to pass, but more may need to be added as the nightlies builds are tested.

See #46732.

File:
1 edited

Legend:

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

    r45602 r45611  
    609609        );
    610610
    611         @wp_mail( $email, __( 'New WordPress Site' ), $message );
     611        wp_mail( $email, __( 'New WordPress Site' ), $message );
    612612    }
    613613endif;
     
    29702970            $index = implode( '', file( "$oldpath/$oldfile" ) );
    29712971            if ( strpos( $index, 'WP_USE_THEMES' ) !== false ) {
    2972                 if ( ! @copy( WP_CONTENT_DIR . '/themes/' . WP_DEFAULT_THEME . '/index.php', "$site_dir/$newfile" ) ) {
     2972                if ( ! copy( WP_CONTENT_DIR . '/themes/' . WP_DEFAULT_THEME . '/index.php', "$site_dir/$newfile" ) ) {
    29732973                    return false;
    29742974                }
     
    29792979        }
    29802980
    2981         if ( ! @copy( "$oldpath/$oldfile", "$site_dir/$newfile" ) ) {
     2981        if ( ! copy( "$oldpath/$oldfile", "$site_dir/$newfile" ) ) {
    29822982            return false;
    29832983        }
     
    30403040    //$files = array('index.php', 'comments.php', 'comments-popup.php', 'footer.php', 'header.php', 'sidebar.php', 'style.css');
    30413041
    3042     $theme_dir = @ opendir( $default_dir );
     3042    $theme_dir = @opendir( $default_dir );
    30433043    if ( $theme_dir ) {
    30443044        while ( ( $theme_file = readdir( $theme_dir ) ) !== false ) {
     
    30463046                continue;
    30473047            }
    3048             if ( ! @copy( "$default_dir/$theme_file", "$site_dir/$theme_file" ) ) {
     3048            if ( ! copy( "$default_dir/$theme_file", "$site_dir/$theme_file" ) ) {
    30493049                return;
    30503050            }
    30513051            chmod( "$site_dir/$theme_file", 0777 );
    30523052        }
    3053     }
    3054     @closedir( $theme_dir );
     3053
     3054        closedir( $theme_dir );
     3055    }
    30553056
    30563057    // Rewrite the theme header.
     
    30823083    }
    30833084
    3084     $images_dir = @ opendir( "$default_dir/images" );
     3085    $images_dir = @opendir( "$default_dir/images" );
    30853086    if ( $images_dir ) {
    30863087        while ( ( $image = readdir( $images_dir ) ) !== false ) {
     
    30883089                continue;
    30893090            }
    3090             if ( ! @copy( "$default_dir/images/$image", "$site_dir/images/$image" ) ) {
     3091            if ( ! copy( "$default_dir/images/$image", "$site_dir/images/$image" ) ) {
    30913092                return;
    30923093            }
    30933094            chmod( "$site_dir/images/$image", 0777 );
    30943095        }
    3095     }
    3096     @closedir( $images_dir );
     3096
     3097        closedir( $images_dir );
     3098    }
    30973099}
    30983100
Note: See TracChangeset for help on using the changeset viewer.