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

The flag FILTER_SANITIZE_STRING is deprecated in PHP 8.1.0 #192

Open
domeales-paloit opened this issue Sep 7, 2023 · 0 comments
Open

The flag FILTER_SANITIZE_STRING is deprecated in PHP 8.1.0 #192

domeales-paloit opened this issue Sep 7, 2023 · 0 comments

Comments

@domeales-paloit
Copy link

Hi there,

We love Gitium, nice one!

We have just noticed after upgrading PHP that the flag FILTER_SANITIZE_STRING is deprecated in PHP 8.1.0.

I would like to submit a PR to replace the use of FILTER_SANITIZE_STRING with FILTER_SANITIZE_FULL_SPECIAL_CHARS. Based on the PHP docs for FILTER_SANITIZE_STRING it says:

Deprecated as of PHP 8.1.0, use htmlspecialchars() instead.

and for FILTER_SANITIZE_FULL_SPECIAL_CHARS it also says:

Equivalent to calling htmlspecialchars() with ENT_QUOTES set.

Therefore, it looks like FILTER_SANITIZE_FULL_SPECIAL_CHARS is a suitable replacement for FILTER_SANITIZE_STRING.

To note also, the constant FILTER_SANITIZE_FULL_SPECIAL_CHARS is available in PHP versions >= 5.3.3.

Would you be happy to receive this PR?

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

No branches or pull requests

1 participant