Skip to content
Snippets Groups Projects
Verified Commit cdefe721 authored by Bartek Jaskulski's avatar Bartek Jaskulski
Browse files

Merge branch 'feature/sanitize-array' into feature/strong-typing

parents a9681e0a 8266e545
No related branches found
No related tags found
3 merge requests!28release: 3.0.0,!25fix: allow TextFieldSanitizer process array values,!19Add strong typing for 3.0 version
Pipeline #6698 passed with stages
in 2 minutes and 15 seconds
# Changelog # Changelog
## [2.4.11]
### Changed
- Allow TextFieldSanitizer to process array values
## [2.4.10] - 2021-10-01 ## [2.4.10] - 2021-10-01
### Changed ### Changed
- Render form data without using echo - Render form data without using echo
......
...@@ -6,7 +6,11 @@ use WPDesk\Forms\Sanitizer; ...@@ -6,7 +6,11 @@ use WPDesk\Forms\Sanitizer;
class TextFieldSanitizer implements Sanitizer { class TextFieldSanitizer implements Sanitizer {
public function sanitize( $value ): string { /** @return string|string[] */
public function sanitize( $value ) {
if ( is_array( $value ) ) {
return array_map('sanitize_text_field', $value);
}
return sanitize_text_field( $value ); return sanitize_text_field( $value );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment