mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Use unlink_if_exists or @unlink to avoid PHP errors when file doesn't exist
Conflicts: usr/local/www/firewall_aliases_edit.php
This commit is contained in:
parent
4b9011f5c5
commit
4bdb08e3b0
@ -1823,7 +1823,7 @@ EOD;
|
||||
} else {
|
||||
if (file_exists("/conf/{$pppif}.log")) {
|
||||
conf_mount_rw();
|
||||
unlink("/conf/{$pppif}.log");
|
||||
@unlink("/conf/{$pppif}.log");
|
||||
conf_mount_ro();
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,8 +36,7 @@
|
||||
|
||||
function dump_rrd_to_xml($rrddatabase, $xmldumpfile) {
|
||||
$rrdtool = "/usr/bin/nice -n20 /usr/local/bin/rrdtool";
|
||||
if(file_exists($xmldumpfile))
|
||||
unlink($xmldumpfile);
|
||||
unlink_if_exists($xmldumpfile);
|
||||
|
||||
exec("$rrdtool dump " . escapeshellarg($rrddatabase) . " {$xmldumpfile} 2>&1", $dumpout, $dumpret);
|
||||
if ($dumpret <> 0) {
|
||||
|
||||
@ -73,7 +73,7 @@ if($_POST)
|
||||
|
||||
// Debugging
|
||||
if($debug)
|
||||
unlink("{$g['tmp_path']}/alias_rename_log.txt");
|
||||
unlink_if_exists("{$g['tmp_path']}/alias_rename_log.txt");
|
||||
|
||||
function alias_same_type($name, $type) {
|
||||
global $config;
|
||||
@ -203,7 +203,7 @@ if ($_POST) {
|
||||
/* fetch down and add in */
|
||||
$isfirst = 0;
|
||||
$temp_filename = tempnam("{$g['tmp_path']}/", "alias_import");
|
||||
unlink($temp_filename);
|
||||
unlink_if_exists($temp_filename);
|
||||
mwexec("/bin/mkdir -p {$temp_filename}");
|
||||
mwexec("/usr/bin/fetch -q -o \"{$temp_filename}/aliases\" " . escapeshellarg($_POST['address' . $x]));
|
||||
/* if the item is tar gzipped then extract */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user