From ec21d0b1354ea04e986dc188cb036bf49ce5d219 Mon Sep 17 00:00:00 2001 From: nilsteampassnet Date: Mon, 23 Oct 2023 15:11:14 +0200 Subject: [PATCH] 3.0.10 Fix for #3903 --- includes/config/include.php | 2 +- sources/main.functions.php | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/includes/config/include.php b/includes/config/include.php index f7beba4dd..b016db2fd 100755 --- a/includes/config/include.php +++ b/includes/config/include.php @@ -17,7 +17,7 @@ */ define('TP_VERSION', '3.0.10'); define("UPGRADE_MIN_DATE", "1697990713"); -define('TP_VERSION_MINOR', '85'); +define('TP_VERSION_MINOR', '86'); define('TP_TOOL_NAME', 'Teampass'); define('TP_ONE_DAY_SECONDS', 86400); define('TP_ONE_WEEK_SECONDS', 604800); diff --git a/sources/main.functions.php b/sources/main.functions.php index 42e84b081..1dbad42a8 100755 --- a/sources/main.functions.php +++ b/sources/main.functions.php @@ -1649,7 +1649,7 @@ function makeThumbnail(string $src, string $dest, int $desired_width) function prefixTable(string $table): string { $safeTable = htmlspecialchars(DB_PREFIX . $table); - if (! empty($safeTable)) { + if (empty($safeTable) === false) { // sanitize string return $safeTable; } @@ -2465,7 +2465,11 @@ function recursiveChmod( // See whether this is a file if (is_file($path)) { // Chmod the file with our given filepermissions - chmod($path, $filePerm); + try { + chmod($path, $filePerm); + } catch (Exception $e) { + return false; + } // If this is a directory... } elseif (is_dir($path)) { // Then get an array of the contents @@ -2479,7 +2483,11 @@ function recursiveChmod( } // When we are done with the contents of the directory, we chmod the directory itself - chmod($path, $dirPerm); + try { + chmod($path, $filePerm); + } catch (Exception $e) { + return false; + } } // Everything seemed to work out well, return true