summaryrefslogtreecommitdiff
path: root/program/include/rcube_vcard.php
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-01-19 08:18:10 +0000
committeralecpl <alec@alec.pl>2009-01-19 08:18:10 +0000
commit478c7c63d8487cf33fa160fade161625176c93d3 (patch)
tree1d5fc96fbc4ba1dede58c0dbb7a8b6bd3147356a /program/include/rcube_vcard.php
parentb7c1685b2dc98cad4acdbc04d5383b204b4d9c83 (diff)
- Secure vcard export by getting rid of preg's 'e' modifier use (#1485689)
Diffstat (limited to 'program/include/rcube_vcard.php')
-rw-r--r--program/include/rcube_vcard.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/program/include/rcube_vcard.php b/program/include/rcube_vcard.php
index 3e93e97e9..1c0c38335 100644
--- a/program/include/rcube_vcard.php
+++ b/program/include/rcube_vcard.php
@@ -226,10 +226,14 @@ class rcube_vcard
return $vcard;
}
+ private static function rfc2425_fold_callback($matches)
+ {
+ return ":\n ".rtrim(chunk_split($matches[1], 72, "\n "));
+ }
private static function rfc2425_fold($val)
{
- return preg_replace('/:([^\n]{72,})/e', '":\n ".rtrim(chunk_split("\\1", 72, "\n "))', $val) . "\n";
+ return preg_replace_callback('/:([^\n]{72,})/', 'self::rfc2425_fold_callback', $val) . "\n";
}