From a00896dc4f88fa0afa91089f12976ae8df7ce23f Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Thu, 28 Nov 2024 04:12:57 -0500 Subject: [PATCH 1/4] Scrutinizer --- admin/permissions.php | 8 ++++++++ preloads/core.php | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/admin/permissions.php b/admin/permissions.php index dade651..b9f9ce6 100644 --- a/admin/permissions.php +++ b/admin/permissions.php @@ -39,8 +39,16 @@ if (!$GLOBALS['xoopsSecurity']->check()) { redirect_header(XOOPS_URL . '/', 3, $GLOBALS['xoopsSecurity']->getErrors()); } + // Get the group input from the request $name = $permHelper->defaultFieldName($permissionName, $permissionItemId); $groups = Request::getVar($name, [], 'POST'); + + // Ensure $groups is an array + if (!is_array($groups)) { + $groups = (array)$groups; + } + + // Save the permission for the item $permHelper->savePermissionForItem($permissionName, $permissionItemId, $groups); xoops_result(_MA_XWHOOPS_FORM_PROCESSED, _MA_XWHOOPS_PERMISSION_FORM); } diff --git a/preloads/core.php b/preloads/core.php index d74875e..c041102 100644 --- a/preloads/core.php +++ b/preloads/core.php @@ -103,12 +103,12 @@ private static function formatQuery(array $query, int $count): string { $error = (null === $query['errno'] ? '' : $query['errno'] . ' ') . ($query['error'] ?? ''); $queryTime = isset($query['query_time']) ? \sprintf('%0.6f', $query['query_time']) : ''; - $queryKey = $count . ' - ' . $queryTime; + $queryKey = $count . ' - ' . ($queryTime ?: 'No Time'); if (null !== $query['errno']) { $queryKey = $count . ' - Error'; } - return \htmlentities($query['sql'], \ENT_QUOTES | \ENT_HTML5) . ' ' . $error; + return $queryKey . ': ' . \htmlentities($query['sql'], \ENT_QUOTES | \ENT_HTML5) . ' ' . $error; } } From 2c908a4fc9f0f28f7f10114c5014a72548f0e86a Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Thu, 28 Nov 2024 04:31:57 -0500 Subject: [PATCH 2/4] multiple PHP versions --- .scrutinizer.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index be48bfe..0c048f4 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -1,15 +1,19 @@ # language: php build: - environment: - php: 8.0.11 nodes: - tests: true analysis: + environment: + php: 8.4 + tools: + php: + target_php_version: 8.4 + min_php_version: 7.4 + backwards_compatibility_checks: true dependencies: after: - # The following installs the most recent XOOPS CMS version, you might want - # to install a specific release tag or branch instead. + # Install the XOOPS CMS and tag module - git clone --depth=1 https://github.com/XOOPS/XoopsCore25 + - git clone --depth=1 https://github.com/mambax7/tag project_setup: override: true tests: @@ -18,3 +22,4 @@ build: filter: dependency_paths: - XoopsCore25/* + - tag/* From 9b3625a507179a5acb3c907880b43cbd10bbf9f3 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Thu, 28 Nov 2024 04:45:30 -0500 Subject: [PATCH 3/4] multiple PHP versions --- .scrutinizer.yml | 53 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 13 deletions(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 0c048f4..cd561bb 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -1,24 +1,51 @@ # language: php build: nodes: - analysis: + analysis-7.4: + environment: + php: 7.4 + tests: + override: + - php-scrutinizer-run --enable-security-analysis + analysis-8.0: + environment: + php: 8.0 + tests: + override: + - php-scrutinizer-run --enable-security-analysis + analysis-8.1: + environment: + php: 8.1 + tests: + override: + - php-scrutinizer-run --enable-security-analysis + analysis-8.2: + environment: + php: 8.2 + tests: + override: + - php-scrutinizer-run --enable-security-analysis + analysis-8.3: + environment: + php: 8.3 + tests: + override: + - php-scrutinizer-run --enable-security-analysis + analysis-8.4: environment: php: 8.4 - tools: - php: - target_php_version: 8.4 - min_php_version: 7.4 - backwards_compatibility_checks: true - dependencies: - after: - # Install the XOOPS CMS and tag module - - git clone --depth=1 https://github.com/XOOPS/XoopsCore25 - - git clone --depth=1 https://github.com/mambax7/tag - project_setup: - override: true tests: override: - php-scrutinizer-run --enable-security-analysis + +dependencies: + after: + - git clone --depth=1 https://github.com/XOOPS/XoopsCore25 + - git clone --depth=1 https://github.com/mambax7/tag + +project_setup: + override: true + filter: dependency_paths: - XoopsCore25/* From 65714cfef1ea195d4e1a13eefdc6aca7827a280b Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Thu, 28 Nov 2024 04:53:07 -0500 Subject: [PATCH 4/4] multiple PHP versions --- .scrutinizer.yml | 49 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index cd561bb..26285bd 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -4,48 +4,81 @@ build: analysis-7.4: environment: php: 7.4 + dependencies: + after: + - git clone --depth=1 https://github.com/XOOPS/XoopsCore25 + - git clone --depth=1 https://github.com/mambax7/tag + project_setup: + override: true tests: override: - php-scrutinizer-run --enable-security-analysis + analysis-8.0: environment: php: 8.0 + dependencies: + after: + - git clone --depth=1 https://github.com/XOOPS/XoopsCore25 + - git clone --depth=1 https://github.com/mambax7/tag + project_setup: + override: true tests: override: - php-scrutinizer-run --enable-security-analysis + analysis-8.1: environment: php: 8.1 + dependencies: + after: + - git clone --depth=1 https://github.com/XOOPS/XoopsCore25 + - git clone --depth=1 https://github.com/mambax7/tag + project_setup: + override: true tests: override: - php-scrutinizer-run --enable-security-analysis + analysis-8.2: environment: php: 8.2 + dependencies: + after: + - git clone --depth=1 https://github.com/XOOPS/XoopsCore25 + - git clone --depth=1 https://github.com/mambax7/tag + project_setup: + override: true tests: override: - php-scrutinizer-run --enable-security-analysis + analysis-8.3: environment: php: 8.3 + dependencies: + after: + - git clone --depth=1 https://github.com/XOOPS/XoopsCore25 + - git clone --depth=1 https://github.com/mambax7/tag + project_setup: + override: true tests: override: - php-scrutinizer-run --enable-security-analysis + analysis-8.4: environment: php: 8.4 + dependencies: + after: + - git clone --depth=1 https://github.com/XOOPS/XoopsCore25 + - git clone --depth=1 https://github.com/mambax7/tag + project_setup: + override: true tests: override: - php-scrutinizer-run --enable-security-analysis -dependencies: - after: - - git clone --depth=1 https://github.com/XOOPS/XoopsCore25 - - git clone --depth=1 https://github.com/mambax7/tag - -project_setup: - override: true - filter: dependency_paths: - XoopsCore25/*