- XSS validation;

- fixed saving radio button field;
This commit is contained in:
nikitasinelnikov
2019-05-08 18:50:25 +03:00
parent 337bbbbbdb
commit aaab2668d6
4 changed files with 31 additions and 7 deletions
+2 -2
View File
@@ -73,7 +73,7 @@ if ( ! class_exists( 'um\core\Validation' ) ) {
}
//validation of correct values from options in wp-admin
if ( in_array( $fields[ $key ]['type'], array( 'select', 'radio' ) ) &&
if ( in_array( $fields[ $key ]['type'], array( 'select' ) ) &&
isset( $value ) && ! empty( $fields[ $key ]['options'] ) &&
! in_array( $value, $fields[ $key ]['options'] ) ) {
unset( $changes[ $key ] );
@@ -81,7 +81,7 @@ if ( ! class_exists( 'um\core\Validation' ) ) {
//validation of correct values from options in wp-admin
//the user cannot set invalid value in the hidden input at the page
if ( in_array( $fields[ $key ]['type'], array( 'multiselect', 'checkbox' ) ) &&
if ( in_array( $fields[ $key ]['type'], array( 'multiselect', 'checkbox', 'radio' ) ) &&
isset( $value ) && ! empty( $fields[ $key ]['options'] ) ) {
$changes[ $key ] = array_intersect( $value, $fields[ $key ]['options'] );