diff --git a/.scrutinizer.yml b/.scrutinizer.yml index be48bfe..26285bd 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -1,20 +1,85 @@ # language: php build: - environment: - php: 8.0.11 nodes: - tests: true - analysis: + analysis-7.4: + environment: + php: 7.4 dependencies: after: - # The following installs the most recent XOOPS CMS version, you might want - # to install a specific release tag or branch instead. - 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 + filter: dependency_paths: - XoopsCore25/* + - tag/* 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; } }