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

Move sanitization functions related functionality to dedicated SanitizingFunctionsTrait #2259

Merged
merged 3 commits into from
Jun 23, 2023

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Jun 20, 2023

The sanitization function lists are only used by a small set of sniffs, so are better placed in a dedicated trait.

The choice for a trait over a class is due to the public properties allowing for adding additional functions to the lists.

Moving both the base function lists + the public properties to the same trait will allow us to encapsulate all the functionality related to the use of these lists in one place.

The $sanitizingFunctions and the $unslashingSanitizingFunctions property, containing the base lists, have also been made private.

Checking whether or not something is a sanitization function should now be done by calling the SanitizingFunctionsTrait::is_sanitizing_function() or the SanitizingFunctionsTrait::is_sanitizing_and_unslashing_function() method.

Related to #1465

…izationFunctionsTrait`

The sanitization function lists are only used by a small set of sniffs, so are better placed in a dedicated trait.

The choice for a `trait` over a `class` is due to the `public` properties allowing for adding additional functions to the lists.

Moving both the base function lists + the `public` properties to the same trait will allow us to encapsulate all the functionality related to the use of these lists in one place.

The `$sanitizingFunctions` and the `$unslashingSanitizingFunctions` property, containing the base lists, have also been made `private`.

Checking whether or not something is a sanitization function should now be done by calling the `SanitizationFunctionsTrait::is_sanitization_function()` or the `SanitizationFunctionsTrait::is_sanitization_and_unslashing_function()` method.

Related to 1465
Copy link
Member

@GaryJones GaryJones left a comment

Choose a reason for hiding this comment

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

✅ Good to squash.

@jrfnl jrfnl changed the title Move sanitization functions related functionality to dedicated SanitizationFunctionsTrait Move sanitization functions related functionality to dedicated SanitizingFunctionsTrait Jun 23, 2023
@jrfnl
Copy link
Member Author

jrfnl commented Jun 23, 2023

Hmm.. I force-pushed the branch and the branch (correctly) says there is now one commit, but this PR still shows as if there were 3 commits... ? Did I just break GH ?

image

@dingo-d
Copy link
Member

dingo-d commented Jun 23, 2023

Yeah, I can see 3 commits.

I don't see a force push commit though 🤷🏼‍♂️

@jrfnl
Copy link
Member Author

jrfnl commented Jun 23, 2023

As this PR doesn't seem to want to update, shall we do Squash commit in the PR itself ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants