File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments