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.
Built from https://develop.svn.wordpress.org/trunk@47617


git-svn-id: http://core.svn.wordpress.org/trunk@47392 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2020-04-24 07:28:10 +00:00
parent 0dc461c72e
commit ced8fb20a1
10 changed files with 25 additions and 30 deletions

View File

@@ -167,11 +167,7 @@ class WP_HTTP_Proxy {
* @return bool True, to send through the proxy and false if, the proxy should not be used.
*/
public function send_through_proxy( $uri ) {
/*
* parse_url() only handles http, https type URLs, and will emit E_WARNING on failure.
* This will be displayed on sites, which is not reasonable.
*/
$check = @parse_url( $uri );
$check = parse_url( $uri );
// Malformed URL, can not process, but this could mean ssl, so let through anyway.
if ( false === $check ) {