From 911c25c3fd4b66e6be4371ec44a0a8b0353992e5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Mar 2013 19:25:49 +0100 Subject: [PATCH] Qual: Better error management --- htdocs/comm/action/class/ical.class.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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 }