mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- fix for registration form;
This commit is contained in:
@@ -33,7 +33,7 @@ if ( ! class_exists( 'um\core\Validation' ) ) {
|
||||
*/
|
||||
public function __construct() {
|
||||
add_filter( 'um_user_pre_updating_files_array', array( $this, 'validate_files' ), 10, 1 );
|
||||
add_filter( 'um_before_save_filter_submitted', array( $this, 'validate_fields_values' ), 10, 2 );
|
||||
add_filter( 'um_before_save_filter_submitted', array( $this, 'validate_fields_values' ), 10, 3 );
|
||||
}
|
||||
|
||||
|
||||
@@ -56,13 +56,8 @@ if ( ! class_exists( 'um\core\Validation' ) ) {
|
||||
return $files;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function validate_fields_values( $changes, $args ) {
|
||||
$fields = array();
|
||||
if ( ! empty( $args['custom_fields'] ) ) {
|
||||
$fields = unserialize( $args['custom_fields'] );
|
||||
}
|
||||
public function validate_fields_values( $changes, $args, $form_data ) {
|
||||
$fields = maybe_unserialize( $form_data['custom_fields'] );
|
||||
|
||||
foreach ( $changes as $key => $value ) {
|
||||
if ( ! isset( $fields[ $key ] ) ) {
|
||||
@@ -124,13 +119,11 @@ if ( ! class_exists( 'um\core\Validation' ) ) {
|
||||
$value = array_map( 'stripslashes', array_map( 'trim', $value ) );
|
||||
$changes[ $key ] = array_intersect( $value, array_map( 'trim', $fields[ $key ]['options'] ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $changes;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Removes html from any string
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user