From 34294e92624d3c38ee2873d29f3fd4ac877689c4 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Wed, 2 Jul 2025 10:29:44 +0300 Subject: [PATCH] refactor(TorrentFileList): reduce duplication in root directory unset logic --- 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 32cc25ad6..960603acc 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);