From: <par...@us...> - 2009-05-29 16:04:27
|
Update of /cvsroot/phpicalendar/phpicalendar/functions In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2591/functions Modified Files: ical_parser.php Log Message: Attempt to parse attendees/organizers without a Common Name attribute and invalid email address Index: ical_parser.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/functions/ical_parser.php,v retrieving revision 1.250 retrieving revision 1.251 diff -C2 -d -r1.250 -r1.251 *** ical_parser.php 27 May 2009 17:21:01 -0000 1.250 --- ical_parser.php 29 May 2009 16:04:23 -0000 1.251 *************** *** 421,434 **** break; case 'ATTENDEE': ! $name = preg_match("/CN=([^;]*)/i", $field, $matches1); ! $email = str_replace("mailto:", "", $data); ! $rsvp = preg_match("/RSVP=([^;]*)/i", $field, $matches2); ! $partstat = preg_match("/PARTSTAT=([^;]*)/i", $field, $matches3); ! $role = preg_match("/ROLE=([^;]*)/i", $field, $matches4); ! $name = ($name ? $matches1[1] : $email); ! $rsvp = ($rsvp ? $matches2[1] : ''); ! $partstat = ($partstat ? $matches3[1] : ''); ! $role = ($role ? $matches4[1] : ''); $attendee[] = array ('name' => stripslashes($name), --- 421,438 ---- break; case 'ATTENDEE': ! $email = preg_match("/mailto:(.*)/i", $data, $matches1); ! $name = preg_match("/CN=([^;]*)/i", $field, $matches2); ! $rsvp = preg_match("/RSVP=([^;]*)/i", $field, $matches3); ! $partstat = preg_match("/PARTSTAT=([^;]*)/i", $field, $matches4); ! $role = preg_match("/ROLE=([^;]*)/i", $field, $matches5); ! $email = ($email ? $matches1[1] : ''); ! $name = ($name ? $matches2[1] : $email); ! $rsvp = ($rsvp ? $matches3[1] : ''); ! $partstat = ($partstat ? $matches4[1] : ''); ! $role = ($role ? $matches5[1] : ''); ! ! // Emergency fallback ! if (empty($name) && empty($email)) $name = $data; $attendee[] = array ('name' => stripslashes($name), *************** *** 440,447 **** break; case 'ORGANIZER': ! $data = str_replace ("mailto:", "", $data); ! $field = preg_match("/CN=([^;]*)/i", $field, $matches); ! $field = ($field ? $matches[1] : $data); ! $organizer[] = array ('name' => stripslashes($field), 'email' => stripslashes($data)); break; case 'LOCATION': --- 444,457 ---- break; case 'ORGANIZER': ! $email = preg_match("/mailto:(.*)/i", $data, $matches1); ! $name = preg_match("/CN=([^;]*)/i", $field, $matches2); ! ! $email = ($email ? $matches1[1] : ''); ! $name = ($name ? $matches2[1] : $email); ! ! // Emergency fallback ! if (empty($name) && empty($email)) $name = $data; ! ! $organizer[] = array ('name' => stripslashes($name), 'email' => stripslashes($email)); break; case 'LOCATION': |