sysutils/sftp-backup: replace getCurrentValue() use

This commit is contained in:
Franco Fichtner
2025-06-30 12:22:30 +02:00
parent 09855f41c3
commit 0908f3aad9
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -1,5 +1,6 @@
PLUGIN_NAME= sftp-backup
PLUGIN_VERSION= 1.1
PLUGIN_REVISION= 1
PLUGIN_COMMENT= Backup configurations using SFTP
PLUGIN_MAINTAINER= ad@opnsense.org
PLUGIN_TIER= 2
@@ -262,8 +262,8 @@ class Sftp extends Base implements IBackupProvider
/* cleanup only if backup count is > 0*/
if ($this->model->backupcount->asFloat() > 0) {
rsort($remote_backups);
if (count($remote_backups) > (int)$this->model->backupcount->getCurrentValue()) {
for ($i = $this->model->backupcount->getCurrentValue(); $i < count($remote_backups); $i++) {
if (count($remote_backups) > (int)$this->model->backupcount->getValue()) {
for ($i = $this->model->backupcount->getValue(); $i < count($remote_backups); $i++) {
$this->del($remote_backups[$i]);
}
$remote_backups = $this->ls(sprintf('%s*.xml', $fileprefix));