Alexander N. Sørnes : util: Replace deprecated ereg call with preg
Module: appdb Branch: master Commit: d9439f493ffda75f3562fd7f8a16c5b3b3ff5c1a URL: http://source.winehq.org/git/appdb.git/?a=commit;h=d9439f493ffda75f3562fd7f8... Author: Alexander N. Sørnes <alexsornes(a)gmail.com> Date: Tue Sep 27 12:23:46 2011 +0200 util: Replace deprecated ereg call with preg --- include/util.php | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/util.php b/include/util.php index add9963..f8a0678 100644 --- a/include/util.php +++ b/include/util.php @@ -121,10 +121,10 @@ function htmlify_urls($text) // html-ify urls $urlreg = "([a-zA-Z]+://([^\t\r\n ]+))"; - $text = ereg_replace($urlreg, "<a href=\"\\1\"> \\2 </a>", $text); + $text = preg_replace($urlreg, "<a href=\"$0\">$1</a>", $text); $emailreg = "([a-zA-Z0-9_%+.-]+@[^\t\r\n ]+)"; - $text = ereg_replace($emailreg, " <a href='mailto:\\1'>\\1</a>", $text); + $text = preg_replace($emailreg, " <a href='mailto:$0'>$0</a>", $text); $text = str_replace("\n", "<br>", $text);
participants (1)
-
Alexander Nicolaysen Sørnes