changeset 19 | 3d72ae0968f4 |
parent 18 | be944660c56a |
--- a/wp/wp-includes/SimplePie/Misc.php Wed Sep 21 18:19:35 2022 +0200 +++ b/wp/wp-includes/SimplePie/Misc.php Tue Sep 27 16:37:53 2022 +0200 @@ -2260,4 +2260,14 @@ { // No-op } + + /** + * Sanitize a URL by removing HTTP credentials. + * @param string $url the URL to sanitize. + * @return string the same URL without HTTP credentials. + */ + public static function url_remove_credentials($url) + { + return preg_replace('#^(https?://)[^/:@]+:[^/:@]+@#i', '$1', $url); + } }