diff options
Diffstat (limited to 'vendor/simplepie/simplepie/library/SimplePie/Misc.php')
-rw-r--r-- | vendor/simplepie/simplepie/library/SimplePie/Misc.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vendor/simplepie/simplepie/library/SimplePie/Misc.php b/vendor/simplepie/simplepie/library/SimplePie/Misc.php index a52498ac7..ce3cf0f54 100644 --- a/vendor/simplepie/simplepie/library/SimplePie/Misc.php +++ b/vendor/simplepie/simplepie/library/SimplePie/Misc.php @@ -2260,4 +2260,14 @@ function embed_wmedia(width, height, link) { { // 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); + } } |