$contact = array();
$image = '';
$event['DESCRIPTION'] = str_replace( '\n', "<br>", $event['DESCRIPTION'] );
+ $event['DESCRIPTION'] = str_replace( '\,', ",", $event['DESCRIPTION'] );
$event['DESCRIPTION'] = str_replace( 'ENCODING=QUOTED-PRINTABLE:', "", $event['DESCRIPTION'] );
$event['DESCRIPTION'] = str_replace( '=0D=0A', "", $event['DESCRIPTION'] );
$event['SUMMARY'] = str_replace( 'ENCODING=QUOTED-PRINTABLE:', "", $event['SUMMARY'] );
+ $event['SUMMARY'] = str_replace( '\,', ",", $event['SUMMARY'] );
$intro = substr( strip_tags( $event['DESCRIPTION'] ), 0 ,150);
if ( isset( $event['CONTACT'] ) ) {
// Remove the backslashes
$old_image = '';
if ( isset( $event['ATTACH'] ) ) {
// See if we already have this image.
- $img_url = preg_replace( '%FMTTYPE=image/(jpeg|gif|png)[:]%', '', $event['ATTACH'] );
- if ( $img_url ) {
+ $img_url = preg_replace( '%FMTTYPE=image/(jpeg|gif|png)[:]|FILENAME=[^:]*[:]%', '', $event['ATTACH'] );
+ if ( $img_url && !preg_match( '%drive.google.com%', $img_url )) ) {
if ( $event_id ) {
$old_image = $this->wpdb->get_var(
$this->wpdb->prepare(
// They'll have VALUE=DATE:YYYMMDD format
if ( isset( $event['DTEND'] ) && preg_match( '%VALUE=DATE:(\d{4})(\d{2})(\d{2})%', $event['DTEND'], $dParts ) ) {
$ending = mktime( 0, 0, 0, $dParts[2], ((int)$dParts[3] - 1), $dParts[1] );
- } else {
+ } else if ( $event['DTEND'] ) {
$ending = $ical->iCalDateToUnixTimestamp( $event['DTEND'] );
+ } else {
+ $ending = $starting;
}
$from_date = date( 'Y-m-d', $starting );