mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@47617 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -522,7 +522,7 @@ function wp_http_validate_url( $url ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$parsed_url = @parse_url( $url );
|
||||
$parsed_url = parse_url( $url );
|
||||
if ( ! $parsed_url || empty( $parsed_url['host'] ) ) {
|
||||
return false;
|
||||
}
|
||||
@@ -535,7 +535,7 @@ function wp_http_validate_url( $url ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$parsed_home = @parse_url( get_option( 'home' ) );
|
||||
$parsed_home = parse_url( get_option( 'home' ) );
|
||||
|
||||
if ( isset( $parsed_home['host'] ) ) {
|
||||
$same_host = strtolower( $parsed_home['host'] ) === strtolower( $parsed_url['host'] );
|
||||
@@ -654,9 +654,6 @@ function ms_allowed_http_request_hosts( $is_external, $host ) {
|
||||
* in the query are being handled inconsistently. This function works around those
|
||||
* differences as well.
|
||||
*
|
||||
* Error suppression is used as prior to PHP 5.3.3, an E_WARNING would be generated
|
||||
* when URL parsing failed.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @since 4.7.0 The `$component` parameter was added for parity with PHP's `parse_url()`.
|
||||
*
|
||||
@@ -684,7 +681,7 @@ function wp_parse_url( $url, $component = -1 ) {
|
||||
$url = 'placeholder://placeholder' . $url;
|
||||
}
|
||||
|
||||
$parts = @parse_url( $url );
|
||||
$parts = parse_url( $url );
|
||||
|
||||
if ( false === $parts ) {
|
||||
// Parsing failure.
|
||||
|
||||
Reference in New Issue
Block a user