-
Notifications
You must be signed in to change notification settings - Fork 74
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
FILTER_SANITIZE_STRING is deprecated #152
Comments
I noticed eleven occurrences of According to what I understand of the code, the idea is to strip the HTML tags from specific inputs. For example, the following method could replace the function filter_input_value(string $string): string {
$str = preg_replace('/\x00|<[^>]*>?/', '', $string);
return str_replace(["'", '"'], ["'", '"'], $str);
} |
@icc are you willing/able to help us identify a helper method or common class? We'd be willing to open a PR for this, if so. |
I quickly looked over the instances and it seems to me that it should be safe to just replace it with |
We run an automated CI/CD pipeline that runs a series of tests. When running the pipeline on a virtual machine running PHP8.1 we get this deprecation warning related to this plugin:
Deprecated: Constant FILTER_SANITIZE_STRING is deprecated in /app/web/app/plugins/h5p/admin/class-h5p-plugin-admin.php on line 547
Looks like
h5p-wordpress-plugin/admin/class-h5p-plugin-admin.php
Line 547 in 661bc44
htmlspecialchars()
.See: https://www.php.net/manual/en/filter.filters.sanitize.php and https://www.php.net/manual/en/function.htmlspecialchars.php
The text was updated successfully, but these errors were encountered: