Skip to content

Commit

Permalink
Update WPCS whitelisting comments
Browse files Browse the repository at this point in the history
These values are actually being sanitized, but because `wp_unslashed()`
is (rightly) being used, WPCS is flagging them. We’ll remove these
comments once this is fixed upstream. See
WordPress/WordPress-Coding-Standards#172

See #324
  • Loading branch information
JDGrimes committed May 1, 2015
1 parent 6b1e9b1 commit 51756a6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/admin/screens/modules-load.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
check_admin_referer( 'bulk-modules' );

$modules = isset( $_POST['checked'] )
? array_map( 'sanitize_text_field', (array) wp_unslash( $_POST['checked'] ) ) // XSS OK WPCS.
? array_map( 'sanitize_text_field', (array) wp_unslash( $_POST['checked'] ) ) // WPCS: sanitization OK.
: array();

// Only activate modules which are not already active.
Expand Down Expand Up @@ -219,7 +219,7 @@ function wordpoints_module_sandbox_scrape( $module ) {
check_admin_referer( 'bulk-modules' );

$modules = isset( $_POST['checked'] )
? array_map( 'sanitize_text_field', (array) wp_unslash( $_POST['checked'] ) ) // XSS OK WPCS.
? array_map( 'sanitize_text_field', (array) wp_unslash( $_POST['checked'] ) ) // WPCS: sanitization OK.
: array();

$network_modules = array_filter( $modules, 'is_wordpoints_module_active_for_network' );
Expand Down Expand Up @@ -262,7 +262,7 @@ function wordpoints_module_sandbox_scrape( $module ) {

// $_POST = from the module form; $_GET = from the FTP details screen.
$modules = isset( $_REQUEST['checked'] )
? array_map( 'sanitize_text_field', (array) wp_unslash( $_REQUEST['checked'] ) ) // XSS OK WPCS.
? array_map( 'sanitize_text_field', (array) wp_unslash( $_REQUEST['checked'] ) ) // WPCS: sanitization OK.
: array();

if ( empty( $modules ) ) {
Expand Down

0 comments on commit 51756a6

Please sign in to comment.