Use !empty instead of isset to prevent accidental deletion of the last used repository URL when firmware update gitsync settings have been saved without a repository URL.

This commit is contained in:
Erik Fonnesbeck 2012-04-26 19:47:57 -06:00
parent f2ff5c8b7a
commit eb2d95f9ba

View File

@ -7,9 +7,9 @@
require_once("functions.inc");
if(file_exists("/usr/local/bin/git") && isset($config['system']['gitsync']['synconupgrade'])) {
if(isset($config['system']['gitsync']['repositoryurl']))
if(!empty($config['system']['gitsync']['repositoryurl']))
exec("cd /root/pfsense/pfSenseGITREPO/pfSenseGITREPO && git config remote.origin.url " . escapeshellarg($config['system']['gitsync']['repositoryurl']));
if(isset($config['system']['gitsync']['branch']))
if(!empty($config['system']['gitsync']['branch']))
system("pfSsh.php playback gitsync " . escapeshellarg($config['system']['gitsync']['branch']) . " --upgrading");
}
@ -25,4 +25,4 @@
if(file_exists($filename))
exec("/bin/rm -f $filename");
?>
?>