From ed4603c5aaab91c56ba49728046504f6e49c53d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Mon, 29 Apr 2024 17:13:10 +0200 Subject: [PATCH] fix: Fix small psalm errors in legacy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- lib/private/legacy/OC_Files.php | 2 +- lib/private/legacy/OC_Helper.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/legacy/OC_Files.php b/lib/private/legacy/OC_Files.php index 1b2f83941c8..7e6d8632642 100644 --- a/lib/private/legacy/OC_Files.php +++ b/lib/private/legacy/OC_Files.php @@ -104,7 +104,7 @@ class OC_Files { * return the content of a file or return a zip file containing multiple files * * @param string $dir - * @param string $files ; separated list of files to download + * @param string|array $files ; separated list of files to download * @param array $params ; 'head' boolean to only send header of the request ; 'range' http range header */ public static function get($dir, $files, $params = null) { diff --git a/lib/private/legacy/OC_Helper.php b/lib/private/legacy/OC_Helper.php index 9a12bd50e0e..7c9810e9081 100644 --- a/lib/private/legacy/OC_Helper.php +++ b/lib/private/legacy/OC_Helper.php @@ -138,7 +138,7 @@ class OC_Helper { $bytes = (float)$str; - if (preg_match('#([kmgtp]?b?)$#si', $str, $matches) && !empty($bytes_array[$matches[1]])) { + if (preg_match('#([kmgtp]?b?)$#si', $str, $matches) && isset($bytes_array[$matches[1]])) { $bytes *= $bytes_array[$matches[1]]; } else { return false;