mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 09:04:53 +01:00
better handling of rogue newlines in ical files imported from other sources.
the legality of the presences of newlines inside an ical record is debatable, but as we have seen, this can and will happen. Fixes https://sourceforge.net/tracker/index.php?func=detail&aid=989070&group_id=78745&atid=554338
This commit is contained in:
parent
d51ed17fab
commit
72f2561223
@ -2985,9 +2985,12 @@
|
||||
{
|
||||
$filename = $this->import_file();
|
||||
$fp=fopen($filename,'rt');
|
||||
$mime_msg = explode("\n",fread($fp, filesize($filename)));
|
||||
$mime_msg = fread($fp, filesize($filename));
|
||||
fclose($fp);
|
||||
unlink($filename);
|
||||
$mime_msg = preg_replace("/(\r\n|\r)/", "\n", $mime_msg); /* dos2unix */
|
||||
$mime_msg = preg_replace("/\n\n+/", "\n", $mime_msg); /* strip duplicate newlines */
|
||||
$mime_msg = explode("\n",$mime_msg); /* explode the sanitized message itself */
|
||||
}
|
||||
elseif(!$mime_msg)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user