From: Florent Bruneau Date: Mon, 17 Sep 2007 22:10:37 +0000 (+0200) Subject: VCard generation speedup. X-Git-Tag: xorg/0.9.15~139 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=833a7481a2ea5f95b533370ab2b30035efa38327;p=platal.git VCard generation speedup. Signed-off-by: Florent Bruneau --- 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)