aboutsummaryrefslogtreecommitdiff
path: root/app/views/entry
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-08-31 12:09:36 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-08-31 12:09:36 +0200
commitf2697be658870fc57b42d8282a10155ecf64bc69 (patch)
tree2a76958de4fa06e76e66f23a937bc7cb1e422e48 /app/views/entry
parent31a6a13268023a2db5eba2445ee6c7db4a6d9623 (diff)
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(). "
Diffstat (limited to 'app/views/entry')
-rwxr-xr-xapp/views/entry/bookmark.phtml2
-rwxr-xr-xapp/views/entry/read.phtml2
2 files changed, 2 insertions, 2 deletions
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 ('#&amp;#i', '&', $url)));
+echo json_encode (array ('url' => str_ireplace ('&amp;', '&', $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 ('#&amp;#i', '&', $url)));
+echo json_encode (array ('url' => str_ireplace ('&amp;', '&', $url)));