Merge branch 'master_MDL-47993' of https://github.com/totara/moodle

This commit is contained in:
Sam Hemelryk
2014-11-17 12:21:16 +13:00
9 changed files with 218 additions and 8 deletions
+4 -2
View File
@@ -287,8 +287,10 @@ class iCalendar_component {
if($parent_component == null) {
$parent_component = $this; // If there's no components on the stack, use the iCalendar object
}
if ($parent_component->add_component($component) === false) {
$this->parser_error("Failed to add component on line $key");
if ($component !== null) {
if ($parent_component->add_component($component) === false) {
$this->parser_error("Failed to add component on line $key");
}
}
if ($parent_component != $this) { // If we're not using the iCalendar
array_push($components, $parent_component); // Put the component back on the stack
+3 -5
View File
@@ -104,9 +104,7 @@ class iCalendar_parameter {
'VIDEO' => array('MPEG', 'QUICKTIME', 'VND.VIVO', 'VND.MOTOROLA.VIDEO', 'VND.MOTOROLA.VIDEOP')
);
$value = strtoupper($value);
if(rfc2445_is_xname($value)) {
return true;
}
// Mimetype is enumerated above and anything else results in false.
@list($type, $subtype) = explode('/', $value);
if(empty($type) || empty($subtype)) {
return false;
@@ -178,7 +176,7 @@ class iCalendar_parameter {
if(empty($value)) {
return false;
}
return (strcspn($value, '";:,') == strlen($value));
return (strcspn($value, ';:,') == strlen($value));
break;
case 'VALUE':
@@ -227,7 +225,7 @@ class iCalendar_parameter {
// Parameters we shouldn't be messing with
case 'TZID':
return $value;
return str_replace('"', '', $value);
break;
}
}
+2
View File
@@ -1227,6 +1227,8 @@ class iCalendar_property_x extends iCalendar_property {
function __construct() {
parent::__construct();
$this->valid_parameters = array(
// X-ALT-DESC (Description) can have FMTTYPE declaration of text/html is a property for HTML content.
'FMTTYPE' => RFC2445_OPTIONAL | RFC2445_ONCE,
'LANGUAGE' => RFC2445_OPTIONAL | RFC2445_ONCE,
RFC2445_XNAME => RFC2445_OPTIONAL
);
+2
View File
@@ -5,3 +5,5 @@ modifications:
2/ replaced mbstring functions with moodle core_text (28 Nov 2011)
3/ replaced explode in iCalendar_component::unserialize() with preg_split to support various line breaks (20 Nov 2012)
4/ updated rfc2445_is_valid_value() to accept single part rrule as a valid value (16 Jun 2014)
5/ updated DTEND;TZID and DTSTAR;TZID values to support quotations (7 Nov 2014)
6/ added calendar_normalize_tz function to convert region timezone to php supported timezone (7 Nov 2014)
+21
View File
@@ -0,0 +1,21 @@
BEGIN:VCALENDAR
PRODID:-//Google Inc//Google Calendar 70.9054//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VEVENT
DTSTART:20141028T213000Z
DTEND:20141028T223000Z
DTSTAMP:20141028T211302Z
ORGANIZER;CN=John Smith:mailto:[email protected]
UID:[email protected]
CREATED:20141028T210927Z
DESCRIPTION:Lorem ipsum dolor sit amet\, consectetur adipisicing elit.
LAST-MODIFIED:20141028T211302Z
LOCATION:150 Willis St\, Te Aro\, Wellington 6011\, New Zealand
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Google calendar
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR
+42
View File
@@ -0,0 +1,42 @@
BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 14.0 MIMEDIR//EN
VERSION:2.0
METHOD:PUBLISH
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
BEGIN:VTIMEZONE
TZID:Central Standard Time
BEGIN:STANDARD
DTSTART:16011104T020000
RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=11
TZOFFSETFROM:-0500
TZOFFSETTO:-0600
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010311T020000
RRULE:FREQ=YEARLY;BYDAY=2SU;BYMONTH=3
TZOFFSETFROM:-0600
TZOFFSETTO:-0500
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
CLASS:PUBLIC
CREATED:20140916T144857Z
DESCRIPTION:\n
DTSTART;TZID="Central Standard Time":20140916T090000
DTSTAMP:20140916T144857Z
DTEND;TZID="Central Standard Time":20140916T093000
LAST-MODIFIED:20140916T144857Z
PRIORITY:5
SEQUENCE:0
SUMMARY;LANGUAGE=en-us:test
TRANSP:OPAQUE
UID:040000008200E00074C5B7101A82E0080000000000D9F06393D1CF010000000000000000100000007B710E58C9CE8146B1403BF7E84162FB
X-ALT-DESC;FMTTYPE=text/html:<!DOCTYPE>\n<HTML>\n<HEAD>\n<TITLE></TITLE>\n</HEAD>\n<BODY>\n<!-- Converted from text/rtf format -->\n\n<P DIR=LTR></P>\n\n</BODY>\n</HTML>
X-MICROSOFT-CDO-BUSYSTATUS:BUSY
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-DISALLOW-COUNTER:FALSE
X-MS-OLK-AUTOFILLLOCATION:TRUE
X-MS-OLK-AUTOSTARTCHECK:FALSE
X-MS-OLK-CONFTYPE:0
END:VEVENT
END:VCALENDAR
+36
View File
@@ -0,0 +1,36 @@
BEGIN:VCALENDAR
CALSCALE:GREGORIAN
VERSION:2.0
METHOD:PUBLISH
X-WR-CALNAME:pokus
X-WR-TIMEZONE:Pacific/Auckland
X-APPLE-CALENDAR-COLOR:#1BADF8
BEGIN:VTIMEZONE
TZID:Pacific/Auckland
BEGIN:DAYLIGHT
TZOFFSETFROM:+1200
RRULE:FREQ=YEARLY;BYMONTH=9;BYDAY=-1SU
DTSTART:20070930T020000
TZNAME:NZDT
TZOFFSETTO:+1300
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+1300
RRULE:FREQ=YEARLY;BYMONTH=4;BYDAY=1SU
DTSTART:20080406T030000
TZNAME:NZST
TZOFFSETTO:+1200
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
CREATED:20141028T204253Z
UID:5571BBDC-AC05-4486-9E57-118EBDFFA385
DTEND;TZID=Pacific/Auckland:20140917T023000
TRANSP:OPAQUE
SUMMARY:Test event
DTSTART;TZID=Pacific/Auckland:20140917T020000
DTSTAMP:20141028T204253Z
SEQUENCE:0
DESCRIPTION:This is a note.
END:VEVENT
END:VCALENDAR