VIP linter fixes#820
VIP linter fixes#820svandragt wants to merge 5 commits intowp-shortcake:masterfrom svandragt:fix/vip-linter-fixes
Conversation
goldenapples
left a comment
There was a problem hiding this comment.
Changes look good, just curious if this sanitization will pass the linter checks.
(Also it would be good to update the coding standards here so that they include VIP coding standards. I'll do that in a followup.)
|
@goldenapples Yes you are correct I thought it would be impossible to get rid of the one remaining warning but the code as it stands doesn't raise any linter issues. Would you mind reviewing? Thanks :) |
| $requested_shortcode = isset( $_GET['shortcode'] ) ? sanitize_text_field( $_GET['shortcode'] ) : null; | ||
| $requested_attr = isset( $_GET['attr'] ) ? sanitize_text_field( $_GET['attr'] ) : null; | ||
|
|
||
| $include = filter_input( INPUT_GET, 'include', FILTER_SANITIZE_NUMBER_INT, FILTER_REQUIRE_ARRAY ); |
There was a problem hiding this comment.
I'm not sure I'm following what FILTER_SANITIZE_NUMBER_INT is doing here, since you map intval over the array a couple lines below. Is the sanitize_int filter just necessary to pass the lint rule?
There was a problem hiding this comment.
Yes this seems like an overzealous linter change really, will revisit this PR and see if it's still relevant.
A couple of issues were highlighted by the wp linter bot.
Sanitizes unsafe $_GET['include'] use and defines $args as an empty array before using it.
Tested against
?include=12,23a,?include[]=12&include[]=23aand without parameter.