diff options
| author | 2013-09-14 11:16:54 -0700 | |
|---|---|---|
| committer | 2013-09-14 11:16:54 -0700 | |
| commit | 980b1ef26ca766469486576b88a3dab95d9c0a29 (patch) | |
| tree | 41b7eb97fece942e003c87a83846c2d8b3b611f8 | |
| parent | 06236ba4463848b1f75fae58ee2ae4d995e273c9 (diff) | |
| parent | f2697be658870fc57b42d8282a10155ecf64bc69 (diff) | |
Merge pull request #152 from Alkarex/AvoidPregReplace
Avoid preg_replace() for simple cases
| -rw-r--r-- | app/models/Feed.php | 2 | ||||
| -rwxr-xr-x | app/views/entry/bookmark.phtml | 2 | ||||
| -rwxr-xr-x | app/views/entry/read.phtml | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/app/models/Feed.php b/app/models/Feed.php index e53df16a1..b3c23d4e8 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); } diff --git a/app/views/entry/bookmark.phtml b/app/views/entry/bookmark.phtml index fe64bb2d8..1ff1c220c 100755 --- a/app/views/entry/bookmark.phtml +++ b/app/views/entry/bookmark.phtml @@ -12,4 +12,4 @@ $url = Url::display (array ( 'params' => Request::params (), )); -echo json_encode (array ('url' => preg_replace ('#&#i', '&', $url))); +echo json_encode (array ('url' => str_ireplace ('&', '&', $url))); diff --git a/app/views/entry/read.phtml b/app/views/entry/read.phtml index 4d0a84f45..6d3313a89 100755 --- a/app/views/entry/read.phtml +++ b/app/views/entry/read.phtml @@ -12,4 +12,4 @@ $url = Url::display (array ( 'params' => Request::params (), )); -echo json_encode (array ('url' => preg_replace ('#&#i', '&', $url))); +echo json_encode (array ('url' => str_ireplace ('&', '&', $url))); |
