Skip to content

Commit 5f8fe49

Browse files
committed
Security/ValidatedSanitizedInput: make closures static
1 parent f69e595 commit 5f8fe49

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

WordPress/Sniffs/Security/ValidatedSanitizedInputSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function process_token( $stackPtr ) {
9090
) {
9191
// Retrieve all embeds, but use only the initial variable name part.
9292
$interpolated_variables = array_map(
93-
function ( $embed ) {
93+
static function ( $embed ) {
9494
return preg_replace( '`^(\{?\$\{?\(?)([a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*)(.*)$`', '$2', $embed );
9595
},
9696
TextStrings::getEmbeds( $this->tokens[ $stackPtr ]['content'] )
@@ -99,7 +99,7 @@ function ( $embed ) {
9999
// Filter the embeds down to superglobals only.
100100
$interpolated_superglobals = array_filter(
101101
$interpolated_variables,
102-
function ( $var_name ) {
102+
static function ( $var_name ) {
103103
return ( 'GLOBALS' !== $var_name && Variables::isSuperglobalName( $var_name ) );
104104
}
105105
);

0 commit comments

Comments
 (0)