diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-01-19 08:18:10 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-01-19 08:18:10 +0000 |
| commit | 1c3f543a8db5ad72d559843eadcc6a3994dcf473 (patch) | |
| tree | 4f71bc7c6c96f33ec28840a7f7ea0422246d013f /roundcubemail/program/include/rcube_vcard.php | |
| parent | 4132a25ff3c8ab334bab0f692448da933d29ae85 (diff) | |
- Secure vcard export by getting rid of preg's 'e' modifier use (#1485689)
git-svn-id: https://svn.roundcube.net/trunk@2241 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcube_vcard.php')
| -rw-r--r-- | roundcubemail/program/include/rcube_vcard.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/roundcubemail/program/include/rcube_vcard.php b/roundcubemail/program/include/rcube_vcard.php index 3e93e97e9..1c0c38335 100644 --- a/roundcubemail/program/include/rcube_vcard.php +++ b/roundcubemail/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"; } |
