WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/09/2019 05:44:42 AM (8 months 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-includes/pluggable.php

    r45590 r45611  
    15231523        $switched_locale = switch_to_locale( get_locale() );
    15241524
    1525         $comment_author_domain = @gethostbyaddr( $comment->comment_author_IP );
     1525        $comment_author_domain = '';
     1526        if ( WP_Http::is_ip_address( $comment->comment_author_IP ) ) {
     1527            $comment_author_domain = gethostbyaddr( $comment->comment_author_IP );
     1528        }
    15261529
    15271530        // The blogname option is escaped with esc_html on the way into the database in sanitize_option
     
    16401643
    16411644        foreach ( $emails as $email ) {
    1642             @wp_mail( $email, wp_specialchars_decode( $subject ), $notify_message, $message_headers );
     1645            wp_mail( $email, wp_specialchars_decode( $subject ), $notify_message, $message_headers );
    16431646        }
    16441647
     
    16971700        $switched_locale = switch_to_locale( get_locale() );
    16981701
    1699         $comment_author_domain = @gethostbyaddr( $comment->comment_author_IP );
    1700         $comments_waiting      = $wpdb->get_var( "SELECT count(comment_ID) FROM $wpdb->comments WHERE comment_approved = '0'" );
     1702        $comment_author_domain = '';
     1703        if ( WP_Http::is_ip_address( $comment->comment_author_IP ) ) {
     1704            $comment_author_domain = gethostbyaddr( $comment->comment_author_IP );
     1705        }
     1706
     1707        $comments_waiting = $wpdb->get_var( "SELECT count(comment_ID) FROM $wpdb->comments WHERE comment_approved = '0'" );
    17011708
    17021709        // The blogname option is escaped with esc_html on the way into the database in sanitize_option
     
    18111818
    18121819        foreach ( $emails as $email ) {
    1813             @wp_mail( $email, wp_specialchars_decode( $subject ), $notify_message, $message_headers );
     1820            wp_mail( $email, wp_specialchars_decode( $subject ), $notify_message, $message_headers );
    18141821        }
    18151822
     
    19481955            $wp_new_user_notification_email_admin = apply_filters( 'wp_new_user_notification_email_admin', $wp_new_user_notification_email_admin, $user, $blogname );
    19491956
    1950             @wp_mail(
     1957            wp_mail(
    19511958                $wp_new_user_notification_email_admin['to'],
    19521959                wp_specialchars_decode( sprintf( $wp_new_user_notification_email_admin['subject'], $blogname ) ),
Note: See TracChangeset for help on using the changeset viewer.