Project

General

Profile

Revision d756b39a

Added by Assos Assos about 8 years ago

Weekly update of contrib modules

View differences:

drupal7/sites/all/modules/date_ical/libraries/ParserVcalendar.inc
224 224
      unset($vcalendar_component->propix[$property_key]);
225 225
    }
226 226

  
227
    if (is_array($text) && isset($vcalendar_component->xprop[$property_key])) {
228
      # This is an X-PROPERTY, which iCalcreator returns as an array like array('X-PROP-NAME', value).
229
      # We only care about the value, though.
230
      $text = $text[1];
231
    }
232

  
227 233
    if ($text === FALSE) {
228 234
      if ($property_key != 'SUMMARY') {
229 235
        return NULL;
......
472 478
        $msg = "The event with UID %uid has an indefinitely repeating RRULE, which the Date Repeat module doesn't support.
473 479
          As a workaround, Date iCal set the repeat count to @count. This value can be customized in the iCal parser settings.";
474 480
        watchdog('date_ical', $msg, array('%uid' => $uid, '@count' => $count), WATCHDOG_WARNING);
475
        if ($this->config['indefinite_message_display']) {
481
        if (!empty($this->config['indefinite_message_display'])) {
476 482
          drupal_set_message(
477 483
            t("At least one of the events in this iCal feed has an indefinitely repeating RRULE, which the Date Repeat module doesn't support.<br>
478 484
              As a workaround, Date iCal set the repeat count to @count. This value can be customized in the iCal parser settings.",
......
481 487
            FALSE
482 488
          );
483 489
        }
484
        $rrule_data['value']['COUNT'] = $this->config['indefinite_count'];
490
        if (isset($this->config['indefinite_count'])) {
491
          $rrule_data['value']['COUNT'] = $this->config['indefinite_count'];
492
        }
493
        else {
494
          // Somehow, it's possible for the config values to have no setting, even though we've given them a default.
495
          // So make really sure we set the COUNT to *something*.
496
          $rrule_data['value']['COUNT'] = 52;
497
        }
485 498
      }
486 499
    }
487 500

  
488
    $rrule = trim($vcalendar_component->createRrule());
489
    $rdate = trim($vcalendar_component->createRdate());
490
    $exrule = trim($vcalendar_component->createExrule());
491
    $exdate = trim($vcalendar_component->createExdate());
501
    # Due to a bug in iCalcreator 2.20.2, any repeat property that's too long to fit on one line will be returned
502
    # verbatim, including the endline and the single-space indentation that starts the second line. Thus, we need to
503
    # remove those things ourselves.
504
    $rrule = trim(preg_replace('/\s/', '', $vcalendar_component->createRrule()));
505
    $rdate = trim(preg_replace('/\s/', '', $vcalendar_component->createRdate()));
506
    $exrule = trim(preg_replace('/\s/', '', $vcalendar_component->createExrule()));
507
    $exdate = trim(preg_replace('/\s/', '', $vcalendar_component->createExdate()));
508

  
492 509
    return "$rrule|$rdate|$exrule|$exdate";
493 510
  }
494 511

  

Also available in: Unified diff