mirror of
https://github.com/opnsense/plugins.git
synced 2026-05-28 04:34:15 -04:00
plugins: style sweep
This commit is contained in:
parent
8d5a155553
commit
ae6185094e
3 changed files with 5 additions and 6 deletions
|
|
@ -187,13 +187,13 @@ class Sftp extends Base implements IBackupProvider
|
|||
/**
|
||||
* @return list of files on remote location
|
||||
*/
|
||||
private function ls($pattern='')
|
||||
private function ls($pattern = '')
|
||||
{
|
||||
$result = [];
|
||||
foreach (explode("\n", $this->sftpCmd('ls -lnt '. $pattern)['stdout']) as $line) {
|
||||
foreach (explode("\n", $this->sftpCmd('ls -lnt ' . $pattern)['stdout']) as $line) {
|
||||
$parts = preg_split('/\s+/', $line, -1, PREG_SPLIT_NO_EMPTY);
|
||||
if (count($parts) >= 7) {
|
||||
$result[] = $parts[count($parts)-1];
|
||||
$result[] = $parts[count($parts) - 1];
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
|
|
@ -249,7 +249,7 @@ class Sftp extends Base implements IBackupProvider
|
|||
/* cleanup */
|
||||
rsort($remote_backups);
|
||||
if (count($remote_backups) > (int)$this->model->backupcount->getCurrentValue()) {
|
||||
for ($i = $this->model->backupcount->getCurrentValue() ; $i < count($remote_backups); $i++) {
|
||||
for ($i = $this->model->backupcount->getCurrentValue(); $i < count($remote_backups); $i++) {
|
||||
$this->del($remote_backups[$i]);
|
||||
}
|
||||
$remote_backups = $this->ls('config-*.xml');
|
||||
|
|
|
|||
|
|
@ -262,4 +262,4 @@
|
|||
</field>
|
||||
</tab>
|
||||
<activetab>general-settings</activetab>
|
||||
</form>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -93,7 +93,6 @@ foreach ((new Caddy())->reverseproxy->reverse->iterateItems() as $reverseItem) {
|
|||
if (!empty($caCertField)) {
|
||||
$refs = array_map('trim', explode(',', $caCertField));
|
||||
foreach ($refs as $ref) {
|
||||
|
||||
if (!empty($ref)) {
|
||||
$caCertRefs[] = $ref;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue