- There are changed PHP’s intval(), strval(), floatval(), and boolval() typecasting functions to (int), (string), (float) and (bool) regarding [this doc](https://make.wordpress.org/core/2020/11/20/miscellaneous-developer-focused-changes-in-wordpress-5-6/).

This commit is contained in:
nikitasinelnikov
2020-11-24 12:55:22 +02:00
parent 0bd61d74d7
commit fa13e82202
10 changed files with 37 additions and 29 deletions
+1 -1
View File
@@ -1130,7 +1130,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
}
}
update_post_meta( $post_id, '_um_search_filters_gmt', intval( $_POST['um-gmt-offset'] ) );
update_post_meta( $post_id, '_um_search_filters_gmt', (int) $_POST['um-gmt-offset'] );
}
+1 -1
View File
@@ -2689,7 +2689,7 @@ Require a strong password: <?php echo $this->info_value( UM()->options()->get('
--- UM Access Configuration ---
Panic Key: <?php echo UM()->options()->get('panic_key') . "\n"; ?>
Global Site Access: <?php $arr = array('Site accessible to Everyone','','Site accessible to Logged In Users'); echo $arr[ intval( UM()->options()->get('accessible') ) ] . "\n"; ?>
Global Site Access: <?php $arr = array('Site accessible to Everyone','','Site accessible to Logged In Users'); echo $arr[ (int) UM()->options()->get('accessible') ] . "\n"; ?>
<?php if( UM()->options()->get('accessible') == 2 ) { ?>
Custom Redirect URL: <?php echo UM()->options()->get('access_redirect')."\n";?>
Exclude the following URLs:<?php echo "\t\t\t\t".implode("\t\n\t\t\t\t\t\t\t\t\t\t",UM()->options()->get('access_exclude_uris') )."\n";?>
+1 -1
View File
@@ -98,7 +98,7 @@ if ( ! class_exists( 'um\core\Form' ) ) {
$arr_options['status'] = 'success';
$arr_options['post'] = $_POST;
UM()->fields()->set_id = intval( $_POST['form_id'] );
UM()->fields()->set_id = absint( $_POST['form_id'] );
UM()->fields()->set_mode = 'profile';
$form_fields = UM()->fields()->get_fields();
$arr_options['fields'] = $form_fields;
@@ -308,14 +308,14 @@ if ( ! class_exists( 'um\core\Member_Directory_Meta' ) ) {
$values_array = array();
foreach ( $value as $single_val ) {
$single_val = stripslashes( $single_val );
$single_val = trim( stripslashes( $single_val ) );
$values_array[] = $wpdb->prepare( "{$join_slug}{$i}.um_value LIKE %s", '%"' . trim( $single_val ) . '"%' );
$values_array[] = $wpdb->prepare( "{$join_slug}{$i}.um_value LIKE %s", '%' . serialize( strval( trim( $single_val ) ) ) . '%' );
$values_array[] = $wpdb->prepare( "{$join_slug}{$i}.um_value = %s", trim( $single_val ) );
$values_array[] = $wpdb->prepare( "{$join_slug}{$i}.um_value LIKE %s", '%"' . $single_val . '"%' );
$values_array[] = $wpdb->prepare( "{$join_slug}{$i}.um_value LIKE %s", '%' . serialize( (string) $single_val ) . '%' );
$values_array[] = $wpdb->prepare( "{$join_slug}{$i}.um_value = %s", $single_val );
if ( is_numeric( $single_val ) ) {
$values_array[] = $wpdb->prepare( "{$join_slug}{$i}.um_value LIKE %s", '%' . serialize( intval( trim( $single_val ) ) ) . '%' );
$values_array[] = $wpdb->prepare( "{$join_slug}{$i}.um_value LIKE %s", '%' . serialize( (int) $single_val ) . '%' );
}
}
@@ -629,7 +629,7 @@ if ( ! class_exists( 'um\core\Member_Directory_Meta' ) ) {
$search_like_string = apply_filters( 'um_member_directory_meta_search_like_type', '%' . $search_line . '%', $search_line );
$this->where_clauses[] = $wpdb->prepare( "( umm_search.um_value = %s OR umm_search.um_value LIKE %s OR umm_search.um_value LIKE %s OR {$core_search}{$additional_search})", $search_line, $search_like_string, '%' . serialize( strval( $search_line ) ) . '%' );
$this->where_clauses[] = $wpdb->prepare( "( umm_search.um_value = %s OR umm_search.um_value LIKE %s OR umm_search.um_value LIKE %s OR {$core_search}{$additional_search})", $search_line, $search_like_string, '%' . serialize( (string) $search_line ) . '%' );
$this->is_search = true;
}
+16 -12
View File
@@ -1429,18 +1429,20 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
if ( ! empty( $_POST['search'] ) ) {
// complex using with change_meta_sql function
$search = trim( stripslashes( $_POST['search'] ) );
$meta_query = array(
'relation' => 'OR',
array(
'value' => trim( stripslashes( $_POST['search'] ) ),
'value' => $search,
'compare' => '=',
),
array(
'value' => trim( stripslashes( $_POST['search'] ) ),
'value' => $search,
'compare' => 'LIKE',
),
array(
'value' => trim( serialize( strval( stripslashes( $_POST['search'] ) ) ) ),
'value' => serialize( (string) $search ),
'compare' => 'LIKE',
),
);
@@ -1614,22 +1616,22 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
$field_query = array( 'relation' => 'OR' );
foreach ( $value as $single_val ) {
$single_val = stripslashes( $single_val );
$single_val = trim( stripslashes( $single_val ) );
$arr_meta_query = array(
array(
'key' => $field,
'value' => trim( $single_val ),
'value' => $single_val,
'compare' => '=',
),
array(
'key' => $field,
'value' => serialize( strval( trim( $single_val ) ) ),
'value' => serialize( (string) $single_val ),
'compare' => 'LIKE',
),
array(
'key' => $field,
'value' => '"' . trim( $single_val ) . '"',
'value' => '"' . $single_val . '"',
'compare' => 'LIKE',
)
);
@@ -1638,7 +1640,7 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
$arr_meta_query[] = array(
'key' => $field,
'value' => serialize( intval( trim( $single_val ) ) ),
'value' => serialize( (int) $single_val ),
'compare' => 'LIKE',
);
@@ -1883,20 +1885,22 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
$field_query = array( 'relation' => 'OR' );
foreach ( $value as $single_val ) {
$single_val = trim( $single_val );
$arr_meta_query = array(
array(
'key' => $field,
'value' => trim( $single_val ),
'value' => $single_val,
'compare' => '=',
),
array(
'key' => $field,
'value' => serialize( strval( trim( $single_val ) ) ),
'value' => serialize( (string) $single_val ),
'compare' => 'LIKE',
),
array(
'key' => $field,
'value' => '"' . trim( $single_val ) . '"',
'value' => '"' . $single_val . '"',
'compare' => 'LIKE',
)
);
@@ -1905,7 +1909,7 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
$arr_meta_query[] = array(
'key' => $field,
'value' => serialize( intval( trim( $single_val ) ) ),
'value' => serialize( (int) $single_val ),
'compare' => 'LIKE',
);
+1 -1
View File
@@ -471,7 +471,7 @@ if ( ! class_exists( 'um\core\Password' ) ) {
}
$attempts = (int) get_user_meta( $user_id, 'password_rst_attempts', true );
$is_admin = user_can( intval( $user_id ),'manage_options' );
$is_admin = user_can( absint( $user_id ),'manage_options' );
if ( UM()->options()->get( 'enable_reset_password_limit' ) ) { // if reset password limit is set
+1 -1
View File
@@ -192,7 +192,7 @@ if ( ! class_exists( 'um\core\Profile' ) ) {
if ( isset( $tab_data['default_privacy'] ) ) {
$privacy = $tab_data['default_privacy'];
} else {
$privacy = intval( UM()->options()->get( 'profile_tab_' . $tab . '_privacy' ) );
$privacy = (int) UM()->options()->get( 'profile_tab_' . $tab . '_privacy' );
}
$privacy = apply_filters( 'um_profile_menu_tab_privacy', $privacy, $tab );
+1 -1
View File
@@ -2013,7 +2013,7 @@ if ( ! class_exists( 'um\core\User' ) ) {
*
*/
function user_exists_by_id( $user_id ) {
$aux = get_userdata( intval( $user_id ) );
$aux = get_userdata( absint( $user_id ) );
if ( $aux == false ) {
return false;
} else {
+4 -4
View File
@@ -733,9 +733,9 @@ function um_profile_dynamic_meta_desc() {
<meta property="og:title" content="<?php echo esc_attr( $title ); ?>"/>
<meta property="og:description" content="<?php echo esc_attr( $description ); ?>"/>
<meta property="og:image" content="<?php echo esc_url( $image ); ?>"/>
<meta property="og:image:alt" content="<?php echo esc_attr_e( 'Profile photo', 'ultimate-member' ); ?>"/>
<meta property="og:image:height" content="<?php echo intval( $size ); ?>"/>
<meta property="og:image:width" content="<?php echo intval( $size ); ?>"/>
<meta property="og:image:alt" content="<?php esc_attr_e( 'Profile photo', 'ultimate-member' ); ?>"/>
<meta property="og:image:height" content="<?php echo (int) $size; ?>"/>
<meta property="og:image:width" content="<?php echo (int) $size; ?>"/>
<meta property="og:url" content="<?php echo esc_url( $url ); ?>"/>
<meta name="twitter:card" content="summary"/>
@@ -743,7 +743,7 @@ function um_profile_dynamic_meta_desc() {
<meta name="twitter:title" content="<?php echo esc_attr( $title ); ?>"/>
<meta name="twitter:description" content="<?php echo esc_attr( $description ); ?>"/>
<meta name="twitter:image" content="<?php echo esc_url( $image ); ?>"/>
<meta name="twitter:image:alt" content="<?php echo esc_attr_e( 'Profile photo', 'ultimate-member' ); ?>"/>
<meta name="twitter:image:alt" content="<?php esc_attr_e( 'Profile photo', 'ultimate-member' ); ?>"/>
<meta name="twitter:url" content="<?php echo esc_url( $url ); ?>"/>
<script type="application/ld+json"><?php echo json_encode( $person ); ?></script>
+5 -1
View File
@@ -155,7 +155,7 @@ 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.1.13: November xx, 2020 =
= 2.1.13: December 8, 2020 =
* Enhancements:
@@ -168,6 +168,10 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
- Fixed: Getting page content of the GDPR privacy policies
- Fixed: Password strength validation for Unicode symbols
* Tweaks:
- There are changed PHPs intval(), strval(), floatval(), and boolval() typecasting functions to (int), (string), (float) and (bool) regarding [this doc](https://make.wordpress.org/core/2020/11/20/miscellaneous-developer-focused-changes-in-wordpress-5-6/).
= 2.1.12: October 29, 2020 =
* Enhancements: