Alexander N.=?UTF-8?Q?=20S=C3=B8rnes=20?=: util: Replace deprecated ereg call with preg

Alexander Nicolaysen Sørnes asornes at winehq.org
Sat Oct 8 09:56:59 CDT 2011


Module: appdb
Branch: master
Commit: d9439f493ffda75f3562fd7f8a16c5b3b3ff5c1a
URL:    http://source.winehq.org/git/appdb.git/?a=commit;h=d9439f493ffda75f3562fd7f8a16c5b3b3ff5c1a

Author: Alexander N. Sørnes <alexsornes at 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);
 




More information about the wine-cvs mailing list