Changeset 31e00cb in github
- Timestamp:
- Sep 5, 2011 3:28:32 AM (22 months ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.7, release-0.8
- Children:
- 4c4fe69
- Parents:
- dbb0c2a
- Files:
-
- 2 edited
-
CHANGELOG (modified) (1 diff)
-
program/include/rcube_vcard.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
rdbb0c2a r31e00cb 2 2 =========================== 3 3 4 - Fixed vCard WORKFAX issue (#1488046) 4 5 - Add vCard's Profile URL support (#1488062) 5 6 - jQuery 1.6.3 -
program/include/rcube_vcard.php
r359e19a r31e00cb 51 51 'edit' => 'X-AB-EDIT', 52 52 ); 53 private $typemap = array('iPhone' => 'mobile', 'CELL' => 'mobile' );54 private $phonetypemap = array('HOME1' => 'HOME', 'BUSINESS1' => 'WORK', 'BUSINESS2' => 'WORK2', 'BUSINESSFAX' => 'WORK FAX');53 private $typemap = array('iPhone' => 'mobile', 'CELL' => 'mobile', 'WORK,FAX' => 'workfax'); 54 private $phonetypemap = array('HOME1' => 'HOME', 'BUSINESS1' => 'WORK', 'BUSINESS2' => 'WORK2', 'BUSINESSFAX' => 'WORK,FAX', 'WORKFAX' => 'WORK,FAX'); 55 55 private $addresstypemap = array('BUSINESS' => 'WORK'); 56 56 private $immap = array('X-JABBER' => 'jabber', 'X-ICQ' => 'icq', 'X-MSN' => 'msn', 'X-AIM' => 'aim', 'X-YAHOO' => 'yahoo', 'X-SKYPE' => 'skype', 'X-SKYPE-USERNAME' => 'skype'); … … 159 159 160 160 if (!empty($raw['type'])) { 161 $subtype = $typemap[$raw['type'][++$k]] ? $typemap[$raw['type'][$k]] : strtolower($raw['type'][$k]); 161 $combined = join(',', self::array_filter((array)$raw['type'], 'internet,pref', true)); 162 $subtype = $typemap[$combined] ? $typemap[$combined] : ($typemap[$raw['type'][++$k]] ? $typemap[$raw['type'][$k]] : strtolower($raw['type'][$k])); 162 163 while ($k < count($raw['type']) && ($subtype == 'internet' || $subtype == 'pref')) 163 164 $subtype = $typemap[$raw['type'][++$k]] ? $typemap[$raw['type'][$k]] : strtolower($raw['type'][$k]); … … 335 336 $this->raw[$tag][$index] = (array)$value; 336 337 if ($type) 337 $this->raw[$tag][$index]['type'] = array(($typemap[$type] ? $typemap[$type] : $type));338 $this->raw[$tag][$index]['type'] = explode(',', ($typemap[$type] ? $typemap[$type] : $type)); 338 339 } 339 340 break; … … 712 713 } 713 714 715 /** 716 * Extract array values by a filter 717 * 718 * @param array Array to filter 719 * @param keys Array or comma separated list of values to keep 720 * @param boolean Invert key selection: remove the listed values 721 * @return array The filtered array 722 */ 723 private static function array_filter($arr, $values, $inverse = false) 724 { 725 if (!is_array($values)) 726 $values = explode(',', $values); 727 728 $result = array(); 729 $keep = array_flip((array)$values); 730 foreach ($arr as $key => $val) 731 if ($inverse != isset($keep[strtolower($val)])) 732 $result[$key] = $val; 733 734 return $result; 735 } 714 736 715 737 /**
Note: See TracChangeset
for help on using the changeset viewer.
