From f2697be658870fc57b42d8282a10155ecf64bc69 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 31 Aug 2013 12:09:36 +0200 Subject: Avoid preg_replace for simple cases Use the faster str_replace() and str_ireplace() instead. From http://www.php.net/manual/function.str-replace.php : "If you don't need fancy replacing rules (like regular expressions), you should always use this function instead of preg_replace(). " --- app/models/Feed.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/models') diff --git a/app/models/Feed.php b/app/models/Feed.php index 678809af6..d55e44db9 100644 --- a/app/models/Feed.php +++ b/app/models/Feed.php @@ -172,7 +172,7 @@ class Feed extends Model { ); } else { $feed = new SimplePie (); - $url = preg_replace ('/&/', '&', $this->url); + $url = str_replace ('&', '&', $this->url); if ($this->httpAuth != '') { $url = preg_replace ('#((.+)://)(.+)#', '${1}' . $this->httpAuth . '@${3}', $url); } -- cgit v1.2.3