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:
Sergey Biryukov
2020-04-24 07:26:57 +00:00
parent d756c57432
commit 055d1c6749
9 changed files with 24 additions and 29 deletions
+3 -3
View File
@@ -866,7 +866,7 @@ function do_enclose( $content = null, $post ) {
foreach ( (array) $post_links_temp as $link_test ) {
// If we haven't pung it already.
if ( ! in_array( $link_test, $pung, true ) ) {
$test = @parse_url( $link_test );
$test = parse_url( $link_test );
if ( false === $test ) {
continue;
}
@@ -901,7 +901,7 @@ function do_enclose( $content = null, $post ) {
$allowed_types = array( 'video', 'audio' );
// Check to see if we can figure out the mime type from the extension.
$url_parts = @parse_url( $url );
$url_parts = parse_url( $url );
if ( false !== $url_parts ) {
$extension = pathinfo( $url_parts['path'], PATHINFO_EXTENSION );
if ( ! empty( $extension ) ) {
@@ -1240,7 +1240,7 @@ function add_magic_quotes( $array ) {
* @return string|false HTTP content. False on failure.
*/
function wp_remote_fopen( $uri ) {
$parsed_url = @parse_url( $uri );
$parsed_url = parse_url( $uri );
if ( ! $parsed_url || ! is_array( $parsed_url ) ) {
return false;