Co-Authors-Plus
Co-Authors-Plus copied to clipboard
add wp_unslash() and sanitize_text_field() calls to inputs
@mjangda Can we merge this?
Noted some spots where the sanitize/unslash are not necessary. We don't really need them for the following either:
-
sanitize_title
-
wp_verify_nonce
- PHPCS will complain if they're not present cc @westonruter
- Do you see any downside to having them present?
PHPCS should be updated to whitelist sanitization usages when an input var is used in array_key_exists()
Filed https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/498
Please provide additional details there.
I would love to use this plugin, but the fact that a PR on input sanitisation has been blocked for a year is giving me pause... Any chance some progress could be made on this please?
@mjangda @westonruter What's the harm in the extra wp_unslash() calls? It's safer/easier to use them everywhere than to create an exception list and manually check it on every code change.
WPCS 3.0 is nearly out, with a much-improved sniffs around this. With the conflicts in the PR, and the desire to see all of PHPCS violations fixed, I'm going to close this one out now, but it can be referred to when a fresh PR is made.