Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
date_ical
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
drupal.org
date_ical
Commits
034c5f5a
Commit
034c5f5a
authored
Nov 01, 2016
by
wizonesolutions
Committed by
Robert Rollins
Nov 01, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #2758689 by wizonesolutions: Multi-line EXDATE components are no longer processed correctly
parent
2f5986c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
1 deletion
+30
-1
libraries/ParserVcalendar.inc
libraries/ParserVcalendar.inc
+30
-1
No files found.
libraries/ParserVcalendar.inc
View file @
034c5f5a
...
...
@@ -504,7 +504,36 @@ class ParserVcalendar {
$rrule
=
trim
(
preg_replace
(
'/\s/'
,
''
,
$vcalendar_component
->
createRrule
()));
$rdate
=
trim
(
preg_replace
(
'/\s/'
,
''
,
$vcalendar_component
->
createRdate
()));
$exrule
=
trim
(
preg_replace
(
'/\s/'
,
''
,
$vcalendar_component
->
createExrule
()));
$exdate
=
trim
(
preg_replace
(
'/\s/'
,
''
,
$vcalendar_component
->
createExdate
()));
// Modules such as Date Repeat, as well as our parsing functions, generally
// expect a single EXDATE entry for optimal operation. If we have multiple
// entries in the data, we should concatenate them here.
$parsed_exdate
=
trim
(
preg_replace
(
'/\s/'
,
''
,
$vcalendar_component
->
createExdate
()));
// First, get the individual contents of any definitions. It's OK even if
// there is only one.
$exdate_parts
=
explode
(
'EXDATE;'
,
$parsed_exdate
);
array_shift
(
$exdate_parts
);
// First element always blank.
// Extended parameters such as VALUE and TZID are set in the first EXDATE
// The other ones must not repeat them. We skip the first entry when
// enforcing this, obviously.
$skip
=
TRUE
;
foreach
(
$exdate_parts
as
&
$exdate_part
)
{
if
(
$skip
)
{
$skip
=
FALSE
;
continue
;
}
// This strips off the part before the colon, since we only want the value
// from the first EXDATE entry. end() wants a real array, hence why two
// lines.
$exdate_part_parts
=
explode
(
':'
,
$exdate_part
);
$exdate_part
=
end
(
$exdate_part_parts
);
}
// Combine the parts back together with an EXDATE; specifier in front.
$exdate
=
'EXDATE;'
.
implode
(
','
,
$exdate_parts
);
return
"
$rrule
|
$rdate
|
$exrule
|
$exdate
"
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment