diff --git a/htdocs/comm/action/class/ical.class.php b/htdocs/comm/action/class/ical.class.php index 3e79d7ada4c..4dc47cdc395 100644 --- a/htdocs/comm/action/class/ical.class.php +++ b/htdocs/comm/action/class/ical.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2011 Juanjo Menent - * Copyright (C) 2012 Laurent Destailleur + * Copyright (C) 2013 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -55,9 +55,15 @@ class ICal function read_file($file) { $this->file = $file; - $file_text = join("", file($file)); //load file - $file_text = preg_replace("/[\r\n]{1,} ([:;])/","\\1",$file_text); - + $file_text=''; + + $tmparray=file($file); + if (is_array($tmparray)) + { + $file_text = join("", $tmparray); //load file + $file_text = preg_replace("/[\r\n]{1,} ([:;])/","\\1",$file_text); + } + return $file_text; // return all text }