From 833a7481a2ea5f95b533370ab2b30035efa38327 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Tue, 18 Sep 2007 00:10:37 +0200 Subject: [PATCH] VCard generation speedup. Signed-off-by: Florent Bruneau --- include/vcard.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/vcard.inc.php b/include/vcard.inc.php index f858b8a..5dd3b68 100644 --- a/include/vcard.inc.php +++ b/include/vcard.inc.php @@ -127,9 +127,9 @@ class VCard public static function escape($text) { if (VCard::$windows) { - return preg_replace('/;/', '\\\\$0', $text); + return str_replace(';', '\\\\;', $text); } else { - return preg_replace('/[,;]/', '\\\\$0', $text); + return str_replace(array(';', ','), array('\\\\;', '\\\\,'), $text); } } @@ -159,7 +159,7 @@ class VCard if (VCard::$windows) { $text = utf8_decode($text); } - return preg_replace("/(\r\n|\n|\r)/", '\n', $text); + return str_replace(array("\r\n", "\n", "\r"), '\n', $text); } public function do_page(&$page) -- 2.1.4