The changes in this commit introduce a bug in the date_ical_parse_text() function.

The str_replace() calls there should no longer be looking for line-breaks followed by spaces, since the spaces are now filtered when the line "unfolding" happens.

This seems to be needed for the 7.x branch as well.

CommentFileSizeAuthor
date_ical_parse_text.patch540 bytesttrafford
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, date_ical_parse_text.patch, failed testing.

ttrafford’s picture

Version: 6.x-2.9 » 6.x-2.x-dev
ttrafford’s picture

Status: Needs work » Needs review

date_ical_parse_text.patch queued for re-testing.

Letharion’s picture

Title: fix for bug introduced in 6.x-2.9 » date_ical_parse_text() incorrectly uses str_replace()

Setting a meningful title.

ttrafford’s picture

From the commit referenced in the main bug report:

- $line = array_pop($icaldata) . ($line);
+ // Trim up to 1 leading space from wrapped line per iCalendar standard.
+ $line = array_pop($icaldata) . (ltrim(substr($line, 0, 1)) . substr($line, 1));

I should have written that this change is needed because the extra space is now removed at the time of unfolding, and so the replace fails when trying to do this:

$data = str_replace(array("\r\n ", "\n ", "\r "), '', $data);

The patch removes the spaces from the ends of the match strings.

DamienMcKenna’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
Issue summary: View changes
Status: Needs review » Patch (to be ported)

Bumped to the D7 branch.