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/functions.php

    r47550 r47617  
    867867        // If we haven't pung it already.
    868868        if ( ! in_array( $link_test, $pung, true ) ) {
    869             $test = @parse_url( $link_test );
     869            $test = parse_url( $link_test );
    870870            if ( false === $test ) {
    871871                continue;
     
    902902
    903903                // Check to see if we can figure out the mime type from the extension.
    904                 $url_parts = @parse_url( $url );
     904                $url_parts = parse_url( $url );
    905905                if ( false !== $url_parts ) {
    906906                    $extension = pathinfo( $url_parts['path'], PATHINFO_EXTENSION );
     
    12411241 */
    12421242function wp_remote_fopen( $uri ) {
    1243     $parsed_url = @parse_url( $uri );
     1243    $parsed_url = parse_url( $uri );
    12441244
    12451245    if ( ! $parsed_url || ! is_array( $parsed_url ) ) {
Note: See TracChangeset for help on using the changeset viewer.