Skip to content

Commit 32512c6

Browse files
committed
Fix simple liniting issues
1 parent 0b203ad commit 32512c6

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

mu-plugins/osi-api/osi-api.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function register_routes() {
4949
'callback' => array( $this, 'get_licenses' ),
5050
'permission_callback' => '__return_true',
5151
'args' => array(
52-
'name' => array(
52+
'name' => array(
5353
'required' => false,
5454
'type' => 'string',
5555
'description' => 'Filter by license name',
@@ -347,8 +347,14 @@ public function handle_redirects() {
347347

348348
// Add query parameters if any
349349
if ( ! empty( $_GET ) ) {
350-
foreach ( $_GET as $key => $value ) {
351-
$request->set_param( $key, $value );
350+
foreach ( $_GET as $key => $value ) { // phpcs:ignore WordPress.Security.NonceVerification
351+
// Sanitize key and value
352+
$sanitized_key = sanitize_key( $key );
353+
$sanitized_value = is_array( $value )
354+
? array_map( 'sanitize_text_field', $value )
355+
: sanitize_text_field( $value );
356+
357+
$request->set_param( $sanitized_key, $sanitized_value );
352358
}
353359
}
354360

0 commit comments

Comments
 (0)