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

Phpcs + PHPstan #184

Merged
merged 7 commits into from
Apr 26, 2024
Merged

Phpcs + PHPstan #184

merged 7 commits into from
Apr 26, 2024

Conversation

Rom1-B
Copy link
Contributor

@Rom1-B Rom1-B commented Apr 25, 2024

Add phpcs + phpstan

@AdrienClairembault
Copy link
Contributor

Are you sure phpcs is running ?
There are a lot of function without the public keyword, which I think should trigger a phpcs failure ?

@Rom1-B
Copy link
Contributor Author

Rom1-B commented Apr 25, 2024

Indeed, it was too simple :(

}
//groups
$query_groups = "INSERT INTO glpi_groups_tickets
if (!$res = $DB->doQuery($query_users)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It look like $tickets is sent from the client, which mean this could become an SQL injection on GLPI 11 when autoescaping is removed.

We should either keep the deprecated query call or not use a raw string query here.

Session::addMessageAfterRedirect(__('Error : adding actors (group)', "escalade"),false, ERROR);
exit;
}
if (!$res = $DB->doQuery($query_groups)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

}

static function filter_actors(array $params = []): array {
if (! $res = $DB->doQuery($query_docs)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Contributor

@stonebuzz stonebuzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems good (hard to read)

@Rom1-B Rom1-B merged commit 3fcf791 into pluginsGLPI:main Apr 26, 2024
3 checks passed
@Rom1-B Rom1-B deleted the phpcs branch April 26, 2024 09:43
@stonebuzz stonebuzz mentioned this pull request May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants