Commit ed5ef9cf authored by Robert Rollins's avatar Robert Rollins

BUGFIX: UNTIL values on RRULES should finally be getting parsed properly.

User RedEight pointed out that I messed up the parse regex for UNTIL values
when I made the recent change regarding DATE-type UNTILs. That's fixed, now.

In addition, I tweaked the iCalcreator version detection regex to be a bit
more forgiving of any possible changes the author makes in his version
definition code.
parent 60c78022
...@@ -168,7 +168,7 @@ function date_ical_libraries_info() { ...@@ -168,7 +168,7 @@ function date_ical_libraries_info() {
'download url' => 'http://github.com/iCalcreator/iCalcreator', 'download url' => 'http://github.com/iCalcreator/iCalcreator',
'version arguments' => array( 'version arguments' => array(
'file' => 'iCalcreator.class.php', 'file' => 'iCalcreator.class.php',
'pattern' => "/define\( 'ICALCREATOR_VERSION', 'iCalcreator ([\d\.]+)' \);/", 'pattern' => "/define.*?ICALCREATOR_VERSION.*?([\d\.]+)/",
'lines' => 100, 'lines' => 100,
), ),
'files' => array( 'files' => array(
......
...@@ -55,7 +55,7 @@ function _date_ical_get_repeat_dates($field_name, $repeat_data, $item, $source) ...@@ -55,7 +55,7 @@ function _date_ical_get_repeat_dates($field_name, $repeat_data, $item, $source)
// It may currently have a Z on it, but only because iCalcreator blindly // It may currently have a Z on it, but only because iCalcreator blindly
// adds one to DATETIME-type UNTILs if it's not there. // adds one to DATETIME-type UNTILs if it's not there.
$matches = array(); $matches = array();
if (preg_match('/^(.*?)UNTIL=(.*?)Z?(.*?)$/', $repeat_data['RRULE'], $matches)) { if (preg_match('/^(.*?)UNTIL=([\dT]+)Z?(.*?)$/', $repeat_data['RRULE'], $matches)) {
// If the UNTIL value doesn't have a "T", it's a DATE, making timezone // If the UNTIL value doesn't have a "T", it's a DATE, making timezone
// fixes irrelvant. // fixes irrelvant.
if (strpos($matches[2], 'T') !== FALSE) { if (strpos($matches[2], 'T') !== FALSE) {
......
...@@ -111,7 +111,7 @@ class DateiCalFeedsParser extends FeedsParser { ...@@ -111,7 +111,7 @@ class DateiCalFeedsParser extends FeedsParser {
'#title' => t('RRULE UNTILs are not in UTC'), '#title' => t('RRULE UNTILs are not in UTC'),
'#type' => 'checkbox', '#type' => 'checkbox',
'#description' => t('Enable this setting if your reccuring events are not repeating the correct number of times. ' . '#description' => t('Enable this setting if your reccuring events are not repeating the correct number of times. ' .
'The iCal spec requires that the UNTIL value in an RRULE be specified in UTC, but some iCal feed creators fail to do this ' . 'The iCal spec requires that the UNTIL value in an RRULE almost always be specified in UTC, but some iCal feed creators fail to follow that rule ' .
'(the UNTIL values in those feeds\' RRULEs don\'t end is "Z"). This causes the UNTIL value to be off by several hours, ' . '(the UNTIL values in those feeds\' RRULEs don\'t end is "Z"). This causes the UNTIL value to be off by several hours, ' .
'which can cause the repeat calculator to miss or add repeats.'), 'which can cause the repeat calculator to miss or add repeats.'),
'#default_value' => $this->config['until_not_utc'], '#default_value' => $this->config['until_not_utc'],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment