diff options
| author | 2015-03-23 21:58:37 +0100 | |
|---|---|---|
| committer | 2015-03-23 21:58:37 +0100 | |
| commit | 7735471140e1c6087a177192a09c7fb849decd77 (patch) | |
| tree | c7ce253ef47118297e2d7443e9bfc79a0eab846c /lib/SimplePie | |
| parent | 0ed213d97f566d7f46747d28a318cf58cdb5d699 (diff) | |
SimplePie faster regex for sanitizing URLs
Can simplify the regex (faster because anchored) for cleaning URLs based
on the fact that we only have to deal with HTTP or HTTPS
https://github.com/FreshRSS/FreshRSS/pull/715
Diffstat (limited to 'lib/SimplePie')
| -rw-r--r-- | lib/SimplePie/SimplePie/Misc.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/SimplePie/SimplePie/Misc.php b/lib/SimplePie/SimplePie/Misc.php index de50d37b8..91549f93a 100644 --- a/lib/SimplePie/SimplePie/Misc.php +++ b/lib/SimplePie/SimplePie/Misc.php @@ -2248,7 +2248,7 @@ function embed_wmedia(width, height, link) { */ function url_remove_credentials($url) //FreshRSS { - return preg_replace('#(?<=//)[^/:@]+:[^/:@]+@#', '', $url); + return preg_replace('#^(https?://)[^/:@]+:[^/:@]+@#i', '$1', $url); } } |
