Sanitize the key as a text field if we don't know what it is
This commit is contained in:
parent
109fbe766c
commit
9f5071051c
|
@ -123,6 +123,8 @@ abstract class AbstractAddressSchema extends AbstractSchema {
|
||||||
array_keys( $address ),
|
array_keys( $address ),
|
||||||
function( $carry, $key ) use ( $address, $validation_util, $field_schema ) {
|
function( $carry, $key ) use ( $address, $validation_util, $field_schema ) {
|
||||||
if ( ! isset( $field_schema[ $key ] ) ) {
|
if ( ! isset( $field_schema[ $key ] ) ) {
|
||||||
|
// Sanitize text field since we have no info about what it *should* be. Sanitizing it is safer than leaving it alone.
|
||||||
|
$carry[ $key ] = sanitize_text_field( $address[ $key ] );
|
||||||
return $carry;
|
return $carry;
|
||||||
}
|
}
|
||||||
switch ( $key ) {
|
switch ( $key ) {
|
||||||
|
|
Loading…
Reference in New Issue