diff --git a/includes/core/class-fields.php b/includes/core/class-fields.php
index 826e3cf2..dd36975a 100644
--- a/includes/core/class-fields.php
+++ b/includes/core/class-fields.php
@@ -378,20 +378,23 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
* @return string
*/
function field_error( $text, $force_show = false ) {
+
+ if( empty( $text ) ) return;
+
if ( $force_show ) {
- $output = '
' . $text . '
';
+ $output = '' . esc_attr( $text ) . '
';
return $output;
}
if ( isset( $this->set_id ) && UM()->form()->processing == $this->set_id ) {
- $output = '' . $text . '
';
+ $output = '' . esc_attr( $text ) . '
';
} else {
$output = '';
}
if ( ! UM()->form()->processing ) {
- $output = '' . $text . '
';
+ $output = '' . esc_attr( $text ) . '
';
}
return $output;
@@ -407,20 +410,23 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
* @return string
*/
function field_notice( $text, $force_show = false ) {
+
+ if( empty( $text ) ) return;
+
if ( $force_show ) {
- $output = '' . $text . '
';
+ $output = '' . esc_attr( $text ) . '
';
return $output;
}
if ( isset( $this->set_id ) && UM()->form()->processing == $this->set_id ) {
- $output = '' . $text . '
';
+ $output = '' . esc_attr( $text ) . '
';
} else {
$output = '';
}
if ( ! UM()->form()->processing ) {
- $output = '' . $text . '
';
+ $output = '' . esc_attr( $text ) . '
';
}
return $output;
diff --git a/includes/core/class-member-directory-meta.php b/includes/core/class-member-directory-meta.php
index 57a77a85..1cc99839 100644
--- a/includes/core/class-member-directory-meta.php
+++ b/includes/core/class-member-directory-meta.php
@@ -435,12 +435,12 @@ if ( ! class_exists( 'um\core\Member_Directory_Meta' ) ) {
} else {
$gmt_offset = get_post_meta( $directory_data['form_id'], '_um_search_filters_gmt', true );
if ( is_numeric( $gmt_offset ) ) {
- $offset = $gmt_offset;
+ $offset = (int) $gmt_offset;
}
}
- $from_date = date( 'Y-m-d H:s:i', strtotime( date( 'Y-m-d H:s:i', min( $value ) ) . "+$offset hours" ) );
- $to_date = date( 'Y-m-d H:s:i', strtotime( date( 'Y-m-d H:s:i', max( $value ) ) . "+$offset hours" ) );
+ $from_date = date( 'Y-m-d H:s:i', strtotime( min( $value ) ) + $offset * HOUR_IN_SECONDS ); // client time zone offset
+ $to_date = date( 'Y-m-d H:s:i', strtotime( max( $value ) ) + $offset * HOUR_IN_SECONDS + DAY_IN_SECONDS - 1 ); // time 23:59
$this->where_clauses[] = $wpdb->prepare( "u.user_registered BETWEEN %s AND %s", $from_date, $to_date );