diff --git a/htdocs/includes/magpierss/rss_fetch.inc b/htdocs/includes/magpierss/rss_fetch.inc index 936cf383abb..87f0c497a25 100644 --- a/htdocs/includes/magpierss/rss_fetch.inc +++ b/htdocs/includes/magpierss/rss_fetch.inc @@ -340,18 +340,19 @@ function init () { if ( !defined('MAGPIE_CACHE_DIR') ) { // Le rep de cache est defini dans DOL_DATA_ROOT - if (! file_exists(DOL_DATA_ROOT.'/rsscache')) { - if (! file_exists(DOL_DATA_ROOT)) { - mkdir(DOL_DATA_ROOT); - } - mkdir(DOL_DATA_ROOT.'/rsscache'); + $ret=true; + if (! file_exists(DOL_DATA_ROOT)) { + $ret=mkdir(DOL_DATA_ROOT); + } + if ($ret && ! file_exists(DOL_DATA_ROOT.'/rsscache')) { + $ret=mkdir(DOL_DATA_ROOT.'/rsscache'); } define('MAGPIE_CACHE_DIR', DOL_DATA_ROOT.'/rsscache'); // Si le rep de cache n'a pu etre trouvé ou créé, on utilise // l'ancien dans DOL_DOCUMENT_ROOT pour raison de compatibilite // avec anciennes versions - if (! file_exists(DOL_DATA_ROOT.'/rsscache')) { + if (! $ret) { define('MAGPIE_CACHE_DIR', DOL_DOCUMENT_ROOT.'/rsscache'); }