diff options
Diffstat (limited to 'lib/simplepie/library/SimplePie/Misc.php')
-rw-r--r-- | lib/simplepie/library/SimplePie/Misc.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/simplepie/library/SimplePie/Misc.php b/lib/simplepie/library/SimplePie/Misc.php index a52498ac7..4318573ba 100644 --- a/lib/simplepie/library/SimplePie/Misc.php +++ b/lib/simplepie/library/SimplePie/Misc.php @@ -2260,4 +2260,16 @@ 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); + } } + +class_alias('SimplePie_Misc', 'SimplePie\Misc', false); |