Replace ereg_replace with str_replace
authorJoey Schulze <joey@infodrom.org>
Mon, 26 Aug 2013 19:12:40 +0000 (19:12 +0000)
committerJoey Schulze <joey@infodrom.org>
Mon, 26 Aug 2013 19:12:40 +0000 (19:12 +0000)
src/logbook/index.wml

index 8ee88ff..9a905bb 100644 (file)
@@ -65,12 +65,9 @@ function teaserlink($teaser)
     for ($nr=0; $nr < pg_NumRows ($sth); $nr++) {
       $row = pg_fetch_array ($sth, $nr);
 
     for ($nr=0; $nr < pg_NumRows ($sth); $nr++) {
       $row = pg_fetch_array ($sth, $nr);
 
-      $body = ereg_replace ("<", "&lt;",
-               ereg_replace (">", "&gt;", 
-                 ereg_replace ("&", "&amp;", 
-                   str_replace ("\\\n", "",
-                     str_replace ("\r", "",
-                       $row['body'])))));
+      $body = str_replace(array('<','>','&',"\\\n","\r"),
+                         array('&lt;', '&gt;', '&amp;', '', ''),
+                         $row['body']);
       $date = explode (" ", $row['created']);
       $time = explode (":", $date[1]);
       $tz = substr($time[2], 2);
       $date = explode (" ", $row['created']);
       $time = explode (":", $date[1]);
       $tz = substr($time[2], 2);