PHPCS complains about our use of unserialize() being insecure. PHPCS complains about ALL uses of unserialize() because if they process user provided data this can be hazardous.
But the way we use it is in a test case to test serialization of our custom RulesExpressions, which is
- Used only when running tests on the testbot, and
- Used with fixed and constrained input.
and there is no way this specific usage poses a security vulnerability for any site that has Rules installed.
Additionally, this same usage of unserialize() is done in core too.
Marking these known usages with @phpcs:ignore will prevent the warnings from polluting our test results, and will serve to document the usage as intentional within the code.
Issue fork rules-3456901
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
tr commentedTests show PHPCS running green again.
Comment #5
tr commented