Commit 579a1b3d authored by Robert Rollins's avatar Robert Rollins
Browse files

Issue #2625002: Fixed warnings thrown during RRULE parsing under some setups.

When I wrote up a fix for one of the changes made in the newest version of Feeds,
I put the fix a few lines after it should have gone. This resulted in blank
RRULEs going undetected when those versions of Feeds are installed, making the
parsing code attempt to parse a blank string, which threw warnings and notices.
parent 534582fc
......@@ -260,17 +260,17 @@ function date_ical_sanitize_text($text = '') {
* Newer versions of Feeds send this value as an array containing the string.
function date_ical_feeds_set_rrule($source, $entity, $target, $repeat_rule) {
if (empty($repeat_rule)) {
// Don't alter the entity if there's no repeat rule.
if (is_array($repeat_rule)) {
// Newer versions of Feeds return $repeat_rule as an array containing the
// string we returned from ParseVcalendar::parseRepeatProperty().
$repeat_rule = reset($repeat_rule);
if (empty($repeat_rule)) {
// Don't alter the entity if there's no repeat rule.
// $target looks like <field_name>:rrule, but we only need <field_name>.
$field_name = current(explode(':', $target, 2));
// Parse the repeat rule into RRULE, RDATE, EXRULE, and EXDATE strings.
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