MDL-30393 lib/bennu minor fixes for RFC-2445 and PHP 5.x support.

This commit is contained in:
Jonathan Harker 2011-11-22 12:53:01 +13:00
parent fe41ba7489
commit 95641b4529
3 changed files with 55 additions and 2 deletions

View file

@ -237,6 +237,11 @@ class iCalendar_component {
$components = array(); // Initialise a stack of components
$this->clear_errors();
foreach ($lines as $key => $line) {
// ignore empty lines
if (trim($line) == '') {
continue;
}
// Divide the line up into label, parameters and data fields.
if (!preg_match('#^(?P<label>[-[:alnum:]]+)(?P<params>(?:;(?:(?:[-[:alnum:]]+)=(?:[^[:cntrl:]";:,]+|"[^[:cntrl:]"]+")))*):(?P<data>.*)$#', $line, $match)) {
$this->parser_error('Invalid line: '.$key.', ignoring');