diff --git a/WordPress/Sniffs/XSS/EscapeOutputSniff.php b/WordPress/Sniffs/XSS/EscapeOutputSniff.php index eb6ac8fe02..a829b1b40d 100644 --- a/WordPress/Sniffs/XSS/EscapeOutputSniff.php +++ b/WordPress/Sniffs/XSS/EscapeOutputSniff.php @@ -291,6 +291,11 @@ public function process_token( $stackPtr ) { continue; } + // Ignore namespace separators. + if ( T_NS_SEPARATOR === $this->tokens[ $i ]['code'] ) { + continue; + } + if ( T_OPEN_PARENTHESIS === $this->tokens[ $i ]['code'] ) { if ( ! isset( $this->tokens[ $i ]['parenthesis_closer'] ) ) { diff --git a/WordPress/Tests/XSS/EscapeOutputUnitTest.inc b/WordPress/Tests/XSS/EscapeOutputUnitTest.inc index e00a1559b1..ab48302626 100644 --- a/WordPress/Tests/XSS/EscapeOutputUnitTest.inc +++ b/WordPress/Tests/XSS/EscapeOutputUnitTest.inc @@ -225,3 +225,15 @@ echo 8 * 1.2; // Ok. foo ?> 'menu genesis-nav-menu menu-footer', + 'theme_location' => 'footer', + ] + ) + ); +}