Minor fixes

This commit is contained in:
Laurent Destailleur
2017-11-24 18:12:01 +01:00
parent 63d2d38c5f
commit 7ea96d53a2
2 changed files with 19 additions and 7 deletions

View File

@@ -278,12 +278,19 @@ class RssParser
dol_syslog(get_class($this)."::parser cache file ".$newpathofdestfile." is saved onto disk.");
if (! dol_is_dir($cachedir)) dol_mkdir($cachedir);
$fp = fopen($newpathofdestfile, 'w');
fwrite($fp, $str);
fclose($fp);
if (! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK;
@chmod($newpathofdestfile, octdec($newmask));
if ($fp)
{
fwrite($fp, $str);
fclose($fp);
if (! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK;
@chmod($newpathofdestfile, octdec($newmask));
$this->_lastfetchdate=$nowgmt;
$this->_lastfetchdate=$nowgmt;
}
else
{
print 'Error, failed to open file '.$newpathofdestfile.' for write';
}
}
unset($str); // Free memory