Index: src/wp-admin/includes/image.php
===================================================================
--- src/wp-admin/includes/image.php	(revision 50565)
+++ src/wp-admin/includes/image.php	(working copy)
@@ -711,7 +711,6 @@
 	);
 
 	$iptc = array();
-	$info = array();
 	/*
 	 * Read IPTC first, since it might contain data not available in exif such
 	 * as caption, description etc.
Index: src/wp-includes/media.php
===================================================================
--- src/wp-includes/media.php	(revision 50565)
+++ src/wp-includes/media.php	(working copy)
@@ -4987,7 +4987,11 @@
 		// Return without silencing errors when in debug mode.
 		defined( 'WP_DEBUG' ) && WP_DEBUG
 	) {
-		return getimagesize( $filename, $image_info );
+		if ( 2 === func_num_args() ) {
+			return getimagesize( $filename, $image_info );
+		} else {
+			return getimagesize( $filename );
+		}
 	}
 
 	/*
@@ -4998,8 +5002,12 @@
 	 * even when it's able to provide image size information.
 	 *
 	 * See https://core.trac.wordpress.org/ticket/42480
-	 *
-	 * phpcs:ignore WordPress.PHP.NoSilencedErrors
 	 */
-	return @getimagesize( $filename, $image_info );
+	if ( 2 === func_num_args() ) {
+		// phpcs:ignore WordPress.PHP.NoSilencedErrors
+		return @getimagesize( $filename, $image_info );
+	} else {
+		// phpcs:ignore WordPress.PHP.NoSilencedErrors
+		return @getimagesize( $filename );
+	}
 }
