Changeset e9aa8c6 in github
- Timestamp:
- Jan 22, 2011 9:00:22 AM (2 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- de06fc3
- Parents:
- ede1744
- File:
-
- 1 edited
-
program/include/rcube_vcard.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
program/include/rcube_vcard.php
r0501b63 re9aa8c6 148 148 $k = -1; 149 149 $key = $col; 150 150 151 $subtype = $typemap[$raw['type'][++$k]] ? $typemap[$raw['type'][$k]] : strtolower($raw['type'][$k]); 151 152 while ($k < count($raw['type']) && ($subtype == 'internet' || $subtype == 'pref')) 152 153 $subtype = $typemap[$raw['type'][++$k]] ? $typemap[$raw['type'][$k]] : strtolower($raw['type'][$k]); 154 155 // read vcard 2.1 subtype 156 if (!$subtype) { 157 foreach ($raw as $k => $v) { 158 if (!is_numeric($k) && $v === true && !in_array(strtolower($k), array('pref','internet','voice','base64'))) { 159 $subtype = $typemap[$k] ? $typemap[$k] : strtolower($k); 160 break; 161 } 162 } 163 } 164 153 165 if ($subtype) 154 166 $key .= ':' . $subtype; … … 279 291 280 292 case 'birthday': 281 if ($val = @strtotime($value))293 if ($val = rcube_strtotime($value)) 282 294 $this->raw['BDAY'][] = array(0 => date('Y-m-d', $val), 'value' => array('date')); 283 295 break; … … 413 425 // Remove cruft like item1.X-AB*, item1.ADR instead of ADR, and empty lines 414 426 $vcard = preg_replace(array('/^item\d*\.X-AB.*$/m', '/^item\d*\./m', "/\n+/"), array('', '', "\n"), $vcard); 427 428 // convert X-WAB-GENDER to X-GENDER 429 if (preg_match('/X-WAB-GENDER:(\d)/', $vcard, $matches)) { 430 $value = $matches[1] == '2' ? 'male' : 'female'; 431 $vcard = preg_replace('/X-WAB-GENDER:\d/', 'X-GENDER:' . $value, $vcard); 432 } 415 433 416 434 // if N doesn't have any semicolons, add some
Note: See TracChangeset
for help on using the changeset viewer.
