From d4d82101dd67c9f4cd86e0f6f909495696974354 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Wed, 2 Jul 2025 10:31:07 +0300 Subject: [PATCH] refactor(TorrentFileList): Reduce duplication in root directory unset logic (#2027) --- src/Legacy/TorrentFileList.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Legacy/TorrentFileList.php b/src/Legacy/TorrentFileList.php index f87c18f48..26617a595 100644 --- a/src/Legacy/TorrentFileList.php +++ b/src/Legacy/TorrentFileList.php @@ -53,8 +53,10 @@ class TorrentFileList $this->build_filelist_array(); if ($this->multiple) { - if (!empty($this->files_ary['/'])) { - $this->files_ary = $this->files_ary + $this->files_ary['/']; + if (isset($this->files_ary['/'])) { + if (!empty($this->files_ary['/'])) { + $this->files_ary = $this->files_ary + $this->files_ary['/']; + } unset($this->files_ary['/']); } $filelist = $html->array2html($this->files_ary);