Fix Undefined array key "fperm" warning

Also removed a few, now unnecessary `!empty` checks

Fixes #3382
This commit is contained in:
Damien Regad 2021-01-26 13:43:49 +01:00
parent ee4f28e375
commit 2342034612
5 changed files with 7 additions and 6 deletions

View File

@ -274,7 +274,7 @@ class PluginController
$backup = $file . '.bak';
if (file_exists($backup)) @unlink($backup);
if (!@copy($file, $backup)) return false;
if (!empty($conf['fperm'])) chmod($backup, $conf['fperm']);
if ($conf['fperm']) chmod($backup, $conf['fperm']);
}
//check if can open for writing, else restore
return io_saveFile($file, $out);

View File

@ -942,7 +942,7 @@ class Indexer {
return false;
}
}
if (!empty($conf['dperm'])) {
if ($conf['dperm']) {
chmod($lock, $conf['dperm']);
}
return $status;

View File

@ -156,7 +156,7 @@ class BulkSubscriptionSender extends SubscriptionSender
return false;
}
if (!empty($conf['dperm'])) {
if ($conf['dperm']) {
chmod($lock, $conf['dperm']);
}
return true;

View File

@ -402,8 +402,9 @@ function init_creationmodes(){
unset($conf['dmask']);
unset($conf['fmask']);
unset($conf['umask']);
unset($conf['fperm']);
unset($conf['dperm']);
$conf['fperm'] = false;
$conf['dperm'] = false;
// get system umask, fallback to 0 if none available
$umask = @umask();

View File

@ -410,7 +410,7 @@ function io_lock($file){
if ((time() - $timeStart) > 3) break;
$locked = @mkdir($lockDir, $conf['dmode']);
if($locked){
if(!empty($conf['dperm'])) chmod($lockDir, $conf['dperm']);
if($conf['dperm']) chmod($lockDir, $conf['dperm']);
break;
}
usleep(50);