From 6f3c839d6575959686eb605227d3ca16ab0054dd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Dec 2017 18:58:08 +0100 Subject: [PATCH] Fix error management --- htdocs/website/class/website.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index 76cc8ff64b7..df0dd8050b6 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -771,6 +771,12 @@ class Website extends CommonObject $website = $this; dol_mkdir($conf->website->dir_temp); + if (! is_writable($conf->website->dir_temp)) + { + setEventMessages("Temporary dir ".$conf->website->dir_temp." is not writable", null, 'errors'); + return ''; + } + $srcdir = $conf->website->dir_output.'/'.$website->ref; $destdir = $conf->website->dir_temp.'/'.$website->ref; @@ -790,7 +796,7 @@ class Website extends CommonObject $fp = fopen($filesql,"w"); if (empty($fp)) { - setEventMessage("Failed to create file ".$filesql, null, 'errors'); + setEventMessages("Failed to create file ".$filesql, null, 'errors'); return ''; }