From aed1ea790e2509141d8d28b4323919c4ea1b56bb Mon Sep 17 00:00:00 2001 From: thibdrev Date: Wed, 31 Jan 2024 21:25:45 +0100 Subject: [PATCH] qual: phpstan for htdocs/core/filemanagerdol/connectors/php/connector.lib.php htdocs/core/filemanagerdol/connectors/php/connector.lib.php 968 Function DetectHtml() should return bool but returns int. htdocs/core/filemanagerdol/connectors/php/connector.lib.php 1027 Function IsImageValid() should return bool but returns int. --- htdocs/core/filemanagerdol/connectors/php/connector.lib.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/htdocs/core/filemanagerdol/connectors/php/connector.lib.php b/htdocs/core/filemanagerdol/connectors/php/connector.lib.php index ca9a01bc37d..02bf537b9cf 100644 --- a/htdocs/core/filemanagerdol/connectors/php/connector.lib.php +++ b/htdocs/core/filemanagerdol/connectors/php/connector.lib.php @@ -954,10 +954,9 @@ function IsHtmlExtension($ext, $formExtensions) /** * Detect HTML in the first KB to prevent against potential security issue with * IE/Safari/Opera file type auto detection bug. - * Returns true if file contain insecure HTML code at the beginning. * * @param string $filePath absolute path to file - * @return boolean + * @return bool|-1 Returns true if the file contains insecure HTML code at the beginning, or -1 if error */ function DetectHtml($filePath) { @@ -1015,11 +1014,10 @@ function DetectHtml($filePath) /** * Check file content. * Currently this function validates only image files. - * Returns false if file is invalid. * * @param string $filePath Absolute path to file * @param string $extension File extension - * @return boolean True or false + * @return bool|-1 Returns true if the file is valid, false if the file is invalid, -1 if error. */ function IsImageValid($filePath, $extension) {