mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-16 13:13:33 +09:00
- fixed sanitizing types;
- fixed `in_group` attribute sanitizing;
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<style type="text/css">
|
||||
<?php
|
||||
|
||||
if ( isset( $max_width ) && $max_width) {
|
||||
if ( isset( $max_width ) && $max_width ) {
|
||||
print ".um-$form_id.um {
|
||||
max-width: $max_width;
|
||||
max-width: {$max_width};
|
||||
}";
|
||||
}
|
||||
|
||||
|
||||
@@ -405,7 +405,7 @@ if ( ! class_exists( 'um\admin\Admin' ) ) {
|
||||
'sanitize' => 'text',
|
||||
),
|
||||
'_um_register_max_width' => array(
|
||||
'sanitize' => 'absint',
|
||||
'sanitize' => 'text',
|
||||
),
|
||||
'_um_register_icons' => array(
|
||||
'sanitize' => 'key',
|
||||
@@ -432,7 +432,7 @@ if ( ! class_exists( 'um\admin\Admin' ) ) {
|
||||
'sanitize' => 'text',
|
||||
),
|
||||
'_um_login_max_width' => array(
|
||||
'sanitize' => 'absint',
|
||||
'sanitize' => 'text',
|
||||
),
|
||||
'_um_login_icons' => array(
|
||||
'sanitize' => 'key',
|
||||
@@ -465,10 +465,10 @@ if ( ! class_exists( 'um\admin\Admin' ) ) {
|
||||
'sanitize' => 'text',
|
||||
),
|
||||
'_um_profile_max_width' => array(
|
||||
'sanitize' => 'absint',
|
||||
'sanitize' => 'text',
|
||||
),
|
||||
'_um_profile_area_max_width' => array(
|
||||
'sanitize' => 'absint',
|
||||
'sanitize' => 'text',
|
||||
),
|
||||
'_um_profile_icons' => array(
|
||||
'sanitize' => 'key',
|
||||
|
||||
@@ -131,7 +131,7 @@ if ( ! class_exists( 'um\admin\core\Admin_DragDrop' ) ) {
|
||||
if ( 0 === strpos( $key, 'um_group_' ) ) {
|
||||
$field_key = str_replace( 'um_group_', '', $key );
|
||||
if ( isset( $fields[ $field_key ] ) ) {
|
||||
$fields[ $field_key ]['in_group'] = absint( $value );
|
||||
$fields[ $field_key ]['in_group'] = ! empty( $value ) ? absint( $value ) : '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -757,10 +757,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
|
||||
'sanitize' => 'text',
|
||||
),
|
||||
'profile_max_width' => array(
|
||||
'sanitize' => 'absint',
|
||||
'sanitize' => 'text',
|
||||
),
|
||||
'profile_area_max_width' => array(
|
||||
'sanitize' => 'absint',
|
||||
'sanitize' => 'text',
|
||||
),
|
||||
'profile_icons' => array(
|
||||
'sanitize' => 'key',
|
||||
@@ -826,7 +826,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
|
||||
'sanitize' => 'text',
|
||||
),
|
||||
'register_max_width' => array(
|
||||
'sanitize' => 'absint',
|
||||
'sanitize' => 'text',
|
||||
),
|
||||
'register_align' => array(
|
||||
'sanitize' => 'key',
|
||||
@@ -853,7 +853,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
|
||||
'sanitize' => 'text',
|
||||
),
|
||||
'login_max_width' => array(
|
||||
'sanitize' => 'absint',
|
||||
'sanitize' => 'text',
|
||||
),
|
||||
'login_align' => array(
|
||||
'sanitize' => 'key',
|
||||
|
||||
@@ -655,21 +655,23 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
|
||||
* Predefined Fields
|
||||
*/
|
||||
function set_predefined_fields() {
|
||||
|
||||
global $wp_roles;
|
||||
$role_keys = get_option( 'um_roles', array() );
|
||||
if ( ! empty( $role_keys ) && is_array( $role_keys ) ) {
|
||||
$role_keys = array_map( function( $item ) {
|
||||
return 'um_' . $item;
|
||||
}, $role_keys );
|
||||
} else {
|
||||
$role_keys = array();
|
||||
|
||||
$um_roles = array();
|
||||
if ( ! empty( $wp_roles->roles ) ) {
|
||||
$role_keys = get_option( 'um_roles', array() );
|
||||
if ( ! empty( $role_keys ) && is_array( $role_keys ) ) {
|
||||
$role_keys = array_map( function( $item ) {
|
||||
return 'um_' . $item;
|
||||
}, $role_keys );
|
||||
} else {
|
||||
$role_keys = array();
|
||||
}
|
||||
|
||||
$exclude_roles = array_diff( array_keys( $wp_roles->roles ), array_merge( $role_keys, array( 'subscriber' ) ) );
|
||||
$um_roles = UM()->roles()->get_roles( false, $exclude_roles );
|
||||
}
|
||||
|
||||
$exclude_roles = array_diff( array_keys( $wp_roles->roles ), array_merge( $role_keys, array( 'subscriber' ) ) );
|
||||
|
||||
$um_roles = UM()->roles()->get_roles( false, $exclude_roles );
|
||||
|
||||
/**
|
||||
* UM hook
|
||||
*
|
||||
|
||||
@@ -155,6 +155,12 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
|
||||
* To learn more about version 2.1 please see this [docs](https://docs.ultimatemember.com/article/1512-upgrade-2-1-0)
|
||||
* UM2.1+ is a significant update to the Member Directories' code base from 2.0.x. Please make sure you take a full-site backup with restore point before updating the plugin
|
||||
|
||||
= 2.2.1: July 22, 2021 =
|
||||
|
||||
* Bugfixes:
|
||||
- Fixed: Sanitizing `max-width` value of the Login/Registration/Profile form settings
|
||||
- Fixed: Sanitizing `in_group` field's data
|
||||
|
||||
= 2.2.0: July 20, 2021 =
|
||||
|
||||
* Enhancements:
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
Plugin Name: Ultimate Member
|
||||
Plugin URI: http://ultimatemember.com/
|
||||
Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress
|
||||
Version: 2.2.0
|
||||
Version: 2.2.1-beta
|
||||
Author: Ultimate Member
|
||||
Author URI: http://ultimatemember.com/
|
||||
Text Domain: ultimate-member
|
||||
|
||||
Reference in New Issue
Block a user