WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/24/2020 07:26:57 AM (21 months ago)
Author:
SergeyBiryukov
Message:

Code Modernization: Remove error suppression from parse_url() calls.

Previously, the @ operator was used to prevent possible warnings emitted by parse_url() in PHP < 5.3.3 when URL parsing failed.

Now that the minimum version of PHP required by WordPress is 5.6.20, this is no longer needed.

Props netpassprodsr, Howdy_McGee.
Fixes #49980. See #24780.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-http-proxy.php

    r47508 r47617  
    168168     */
    169169    public function send_through_proxy( $uri ) {
    170         /*
    171          * parse_url() only handles http, https type URLs, and will emit E_WARNING on failure.
    172          * This will be displayed on sites, which is not reasonable.
    173          */
    174         $check = @parse_url( $uri );
     170        $check = parse_url( $uri );
    175171
    176172        // Malformed URL, can not process, but this could mean ssl, so let through anyway.
Note: See TracChangeset for help on using the changeset viewer.