forked from extern/egroupware
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
338c962e71
commit
efdf383dc4
@ -2985,9 +2985,12 @@
|
|||||||
{
|
{
|
||||||
$filename = $this->import_file();
|
$filename = $this->import_file();
|
||||||
$fp=fopen($filename,'rt');
|
$fp=fopen($filename,'rt');
|
||||||
$mime_msg = explode("\n",fread($fp, filesize($filename)));
|
$mime_msg = fread($fp, filesize($filename));
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
unlink($filename);
|
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)
|
elseif(!$mime_msg)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user