Mercurial > hg > rc2
comparison program/lib/Roundcube/rcube_vcard.php @ 11:aff04b06b685
various small fixes from upgrades to PHP and/or hangover from fix to apt-get overwrite at beginning of the year somehow
| author | Charlie Root |
|---|---|
| date | Sun, 26 Jan 2025 13:09:03 -0500 |
| parents | 4681f974d28b |
| children | 5039cc34571f |
comparison
equal
deleted
inserted
replaced
| 10:8e3cc6fc791d | 11:aff04b06b685 |
|---|---|
| 523 */ | 523 */ |
| 524 public static function cleanup($vcard) | 524 public static function cleanup($vcard) |
| 525 { | 525 { |
| 526 // convert Apple X-ABRELATEDNAMES into X-* fields for better compatibility | 526 // convert Apple X-ABRELATEDNAMES into X-* fields for better compatibility |
| 527 $vcard = preg_replace_callback( | 527 $vcard = preg_replace_callback( |
| 528 '/item(\d+)\.(X-ABRELATEDNAMES)([^:]*?):(.*?)item\1.X-ABLabel:(?:_\$!<)?([\w-() ]*)(?:>!\$_)?./s', | 528 '/item(\d+)\.(X-ABRELATEDNAMES)([^:]*?):(.*?)item\1.X-ABLabel:(?:_\$!<)?([\w\-() ]*)(?:>!\$_)?./s', |
| 529 array('self', 'x_abrelatednames_callback'), | 529 array('self', 'x_abrelatednames_callback'), |
| 530 $vcard); | 530 $vcard); |
| 531 | 531 |
| 532 // Cleanup | 532 // Cleanup |
| 533 $vcard = preg_replace(array( | 533 $vcard = preg_replace(array( |
| 534 // convert special types (like Skype) to normal type='skype' classes with this simple regex ;) | 534 // convert special types (like Skype) to normal type='skype' classes with this simple regex ;) |
| 535 '/item(\d+)\.(TEL|EMAIL|URL)([^:]*?):(.*?)item\1.X-ABLabel:(?:_\$!<)?([\w-() ]*)(?:>!\$_)?./si', | 535 '/item(\d+)\.(TEL|EMAIL|URL)([^:]*?):(.*?)item\1.X-ABLabel:(?:_\$!<)?([\w\-() ]*)(?:>!\$_)?./si', |
| 536 '/^item\d*\.X-AB.*$/mi', // remove cruft like item1.X-AB* | 536 '/^item\d*\.X-AB.*$/mi', // remove cruft like item1.X-AB* |
| 537 '/^item\d*\./mi', // remove item1.ADR instead of ADR | 537 '/^item\d*\./mi', // remove item1.ADR instead of ADR |
| 538 '/\n+/', // remove empty lines | 538 '/\n+/', // remove empty lines |
| 539 '/^(N:[^;\R]*)$/m', // if N doesn't have any semicolons, add some | 539 '/^(N:[^;\R]*)$/m', // if N doesn't have any semicolons, add some |
| 540 ), | 540 ), |
