summaryrefslogtreecommitdiff
path: root/lib/lib_rss.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lib_rss.php')
-rw-r--r--lib/lib_rss.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/lib_rss.php b/lib/lib_rss.php
index 68abe602c..d4f41cf5c 100644
--- a/lib/lib_rss.php
+++ b/lib/lib_rss.php
@@ -429,3 +429,13 @@ function array_push_unique(&$array, $value) {
function array_remove(&$array, $value) {
$array = array_diff($array, array($value));
}
+
+
+/**
+ * Sanitize a URL by removing HTTP credentials.
+ * @param $url the URL to sanitize.
+ * @return the same URL without HTTP credentials.
+ */
+function url_remove_credentials($url) {
+ return preg_replace('#((.+)://)((.+)@)?(.+)#', '${1}${5}', $url);
+}