h5p-editor-php-library
h5p-editor-php-library copied to clipboard
Replace deprecated FILTER_SANITIZE_STRING
FILTER_SANITIZE_STRING is deprecated since PHP 8.0
Just came to this PR from elsewhere...
guessing if the replacement proposed here is enough, or we also have to apply for strip_tags()
, as far as the, now deprecated in php 8.1, FILTER_SANITIZE_STRING
also performed such stripping.
So, basically, in order to get 99% the same results than before, any of this should be ok, I think they are the same:
-
filter_var(strip_tags($input), FILTER_SANITIZE_FULL_SPECIAL_CHARS, FILTER_FLAG_NO_ENCODE_QUOTES))
-
htmlspecialchars(strip_tags($input), ENT_NOQUOTES))
Link: https://3v4l.org/7rphp (to see the behaviour both without and with FILTER_FLAG_NO_ENCODE_QUOTES
)
Not sure how that tags stripping is important or no, just sharing that the original was performing it.
Ciao :-)
Just checking if there are any updates on this PR.
Looks good, thanks :)