Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrutinizer #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 71 additions & 6 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -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/*
8 changes: 8 additions & 0 deletions admin/permissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions preloads/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}