mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- fixed maybe serialized custom fields;
- fixed sanitizing;
This commit is contained in:
@@ -678,8 +678,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
|
||||
$save[ $_metakey ] = null;
|
||||
foreach ( $array['post'] as $key => $val ) {
|
||||
|
||||
if ( substr( $key, 0, 1 ) === '_' && $val != '' ) { // field attribute
|
||||
$new_key = ltrim ($key,'_');
|
||||
if ( substr( $key, 0, 1 ) === '_' && $val !== '' ) { // field attribute
|
||||
$new_key = ltrim ( $key, '_' );
|
||||
|
||||
if ( $new_key == 'options' ) {
|
||||
//$save[ $_metakey ][$new_key] = explode(PHP_EOL, $val);
|
||||
@@ -689,6 +689,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
|
||||
}
|
||||
|
||||
} elseif ( strstr( $key, 'um_editor' ) ) {
|
||||
|
||||
if ( 'block' === $array['post']['_type'] ) {
|
||||
$save[ $_metakey ]['content'] = wp_kses_post( $val );
|
||||
} else {
|
||||
|
||||
@@ -3783,11 +3783,15 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
/**
|
||||
* Get fields in row
|
||||
*
|
||||
* @param integer $row_id
|
||||
* @param int $row_id
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_fields_by_row( $row_id ) {
|
||||
if ( ! isset( $this->get_fields ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
foreach ( $this->get_fields as $key => $array ) {
|
||||
if ( ! isset( $array['in_row'] ) || ( isset( $array['in_row'] ) && $array['in_row'] == $row_id ) ) {
|
||||
$results[ $key ] = $array;
|
||||
|
||||
@@ -697,6 +697,7 @@ function um_user_submitted_registration_formatted( $style = false ) {
|
||||
|
||||
if ( isset( $submitted_data['form_id'] ) ) {
|
||||
$fields = UM()->query()->get_attr( 'custom_fields', $submitted_data['form_id'] );
|
||||
$fields = maybe_unserialize( $fields );
|
||||
}
|
||||
|
||||
if ( isset( $fields ) ) {
|
||||
@@ -717,10 +718,10 @@ function um_user_submitted_registration_formatted( $style = false ) {
|
||||
if ( empty( $rows ) ) {
|
||||
$rows = array(
|
||||
'_um_row_1' => array(
|
||||
'type' => 'row',
|
||||
'id' => '_um_row_1',
|
||||
'sub_rows' => 1,
|
||||
'cols' => 1
|
||||
'type' => 'row',
|
||||
'id' => '_um_row_1',
|
||||
'sub_rows' => 1,
|
||||
'cols' => 1,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user