Index: src/wp-includes/http.php
===================================================================
--- src/wp-includes/http.php	(Revision 62496)
+++ src/wp-includes/http.php	(Arbeitskopie)
@@ -750,11 +750,56 @@
 		$url        = 'placeholder://placeholder' . $url;
 	}
 
-	$parts = parse_url( $url );
+	/*
+	 * PHP 8.5+: Prefer the WHATWG URL parser.
+	 */
+	if ( class_exists( 'Uri\\WhatWg\\Url' ) ) {
+		try {
+			$parsed = \Uri\WhatWg\Url::parse( $url );
 
-	if ( false === $parts ) {
-		// Parsing failure.
-		return $parts;
+			$parts = array();
+
+			if ( '' !== $parsed->scheme ) {
+				$parts['scheme'] = $parsed->scheme;
+			}
+
+			if ( '' !== $parsed->host ) {
+				$parts['host'] = $parsed->host;
+			}
+
+			if ( null !== $parsed->port ) {
+				$parts['port'] = $parsed->port;
+			}
+
+			if ( '' !== $parsed->username ) {
+				$parts['user'] = $parsed->username;
+			}
+
+			if ( '' !== $parsed->password ) {
+				$parts['pass'] = $parsed->password;
+			}
+
+			if ( '' !== $parsed->path ) {
+				$parts['path'] = $parsed->path;
+			}
+
+			if ( '' !== $parsed->query ) {
+				$parts['query'] = $parsed->query;
+			}
+
+			if ( '' !== $parsed->fragment ) {
+				$parts['fragment'] = $parsed->fragment;
+			}
+		} catch ( \Throwable $e ) {
+			return false;
+		}
+	} else {
+		$parts = parse_url( $url );
+
+		if ( false === $parts ) {
+			// Parsing failure.
+			return false;
+		}
 	}
 
 	// Remove the placeholder values.
