Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/events-manager/classes/em-booking.php
+++ b/events-manager/classes/em-booking.php
@@ -31,6 +31,20 @@
}
}
/**
+ * Resolve a booking from a request-supplied id. Accepts only a positive integer id or a 32-character booking UUID; any other value (notably an array, which would otherwise be mass-assigned onto a new EM_Booking) returns an empty booking.
+ * @param mixed $value
+ * @return EM_Booking
+ */
+function em_get_booking_request( $value ) {
+ if ( is_numeric( $value ) ) {
+ return em_get_booking( absint( $value ) );
+ }
+ if ( is_string( $value ) && preg_match( '/^[A-Za-z0-9]{32}$/', $value ) ) {
+ return em_get_booking( $value );
+ }
+ return em_get_booking();
+}
+/**
* Contains all information and relevant functions surrounding a single booking made with Events Manager
* @property int|false $booking_status
* @property string $language
@@ -1336,8 +1350,12 @@
global $wpdb;
$action_string = strtolower($this->status_array[$status]);
//if we're approving we can't approve a booking if spaces are full, so check before it's approved.
+ // Hold a per-event lock across the full-check and the status write so two concurrent approvals can't both pass a stale space count and overbook.
+ $status_lock_event_id = ( !$ignore_spaces && $status == 1 ) ? $this->get_event_id() : 0;
+ $status_locked = $status_lock_event_id ? EM_Bookings::acquire_lock( $status_lock_event_id ) : false;
if(!$ignore_spaces && $status == 1){
- if( !$this->is_reserved() && $this->get_event()->get_bookings()->get_available_spaces() < $this->get_spaces() && !$this->get_option('dbem_bookings_approval_overbooking') ){
+ if( !$this->is_reserved() && $this->get_event()->get_bookings()->get_available_spaces(true) < $this->get_spaces() && !$this->get_option('dbem_bookings_approval_overbooking') ){
+ if( $status_locked ) EM_Bookings::release_lock( $status_lock_event_id );
$this->feedback_message = sprintf(__('Not approved, spaces full.','events-manager'), $action_string);
$this->add_error($this->feedback_message);
return apply_filters('em_booking_set_status', false, $this);
@@ -1346,6 +1364,7 @@
$this->previous_status = $this->booking_status;
$this->booking_status = absint($status);
$result = $wpdb->query($wpdb->prepare('UPDATE '.EM_BOOKINGS_TABLE.' SET booking_status=%d WHERE booking_id=%d', array($status, $this->booking_id)));
+ if( $status_locked ) EM_Bookings::release_lock( $status_lock_event_id );
if($result !== false){
$this->flush_event_cache();
$this->update_meta('previous_status', $this->previous_status);
--- a/events-manager/classes/em-bookings-table.php
+++ b/events-manager/classes/em-bookings-table.php
@@ -386,7 +386,7 @@
do_action( static::$basename . '_ajax_table_row_action_' . $requested_action );
do_action( static::$basename . '_ajax_table_row_action', $requested_action );
$allowed_actions = array('bookings_approve'=>'approve','bookings_reject'=>'reject','bookings_unapprove'=>'unapprove', 'bookings_delete'=>'delete');
- $EM_Booking = ( !empty($_REQUEST['booking_id']) ) ? em_get_booking($_REQUEST['booking_id']) : em_get_booking();
+ $EM_Booking = em_get_booking_request( $_REQUEST['booking_id'] ?? false );
if( ( array_key_exists($requested_action, $allowed_actions) || in_array( $requested_action, $allowed_actions )) && $EM_Booking->can_manage('manage_bookings','manage_others_bookings') ){
//Event Admin only actions
$action = $allowed_actions[$requested_action] ?? $requested_action;
--- a/events-manager/classes/em-bookings.php
+++ b/events-manager/classes/em-bookings.php
@@ -155,6 +155,39 @@
* @param EM_Booking $EM_Booking
* @return boolean
*/
+ /**
+ * Acquire a short-lived MySQL advisory lock scoped to one event's bookings, so the availability check and the insert run as one critical section and concurrent requests can't each pass a stale space count and oversell. Best-effort: returns false if the lock can't be taken, in which case callers fall back to a non-atomic re-check rather than blocking a legitimate booking.
+ * @param int $event_id
+ * @param int $timeout seconds to wait for the lock
+ * @return bool whether the lock was acquired
+ */
+ public static function acquire_lock( $event_id, $timeout = 10 ){
+ global $wpdb;
+ if( empty($event_id) ) return false;
+ $got = $wpdb->get_var( $wpdb->prepare( 'SELECT GET_LOCK(%s, %d)', self::lock_name($event_id), $timeout ) );
+ return $got === '1' || $got === 1;
+ }
+
+ /**
+ * Release a lock previously taken with acquire_lock(). Safe to call only when acquire_lock() returned true.
+ * @param int $event_id
+ */
+ public static function release_lock( $event_id ){
+ global $wpdb;
+ if( empty($event_id) ) return;
+ $wpdb->get_var( $wpdb->prepare( 'SELECT RELEASE_LOCK(%s)', self::lock_name($event_id) ) );
+ }
+
+ /**
+ * GET_LOCK names are global to the MySQL server and capped at 64 characters, so namespace by database and table prefix: a collision between unrelated installs on a shared server would only cost extra serialization, never correctness.
+ * @param int $event_id
+ * @return string
+ */
+ protected static function lock_name( $event_id ){
+ global $wpdb;
+ return 'em_bk_' . md5( DB_NAME . '|' . $wpdb->prefix . '|' . absint($event_id) );
+ }
+
function add( $EM_Booking ){
//Save the booking
$email = false;
@@ -162,7 +195,18 @@
if( empty($EM_Booking->booking_status) ){ //if status is not set, give 1 or 0 depending on approval settings
$EM_Booking->booking_status = em_get_option('dbem_bookings_approval') ? 0:1;
}
+ // Re-check availability against a fresh count, holding a per-event lock across the check and the insert so two concurrent bookings can't both pass a stale space count. The caller already validated, but that count can be stale by the time we save. Skipped when restrictions are disabled (e.g. manual bookings, which may intentionally overbook).
+ $lock_event_id = $EM_Booking->get_event_id();
+ $booking_locked = self::acquire_lock( $lock_event_id );
+ if( !self::$disable_restrictions && $EM_Booking->get_event()->get_bookings()->get_available_spaces(true) < $EM_Booking->get_spaces() ){
+ if( $booking_locked ) self::release_lock( $lock_event_id );
+ $EM_Booking->add_error( $EM_Booking->get_option('dbem_booking_feedback_full') );
+ $this->feedback_message = $EM_Booking->get_option('dbem_booking_feedback_full');
+ $this->errors = array_merge( $this->errors, $EM_Booking->get_errors() );
+ return apply_filters('em_bookings_add', false, $EM_Booking);
+ }
$result = $EM_Booking->save(false);
+ if( $booking_locked ) self::release_lock( $lock_event_id );
if ( $result ){
//Success
do_action('em_bookings_added', $EM_Booking);
--- a/events-manager/classes/em-event.php
+++ b/events-manager/classes/em-event.php
@@ -1161,7 +1161,7 @@
}
}else{
// if no rsvp cut-off date supplied, make it the event start date
- $this->event_rsvp_date = ( !empty($_POST['event_rsvp_date']) ) ? wp_kses_data($_POST['event_rsvp_date']) : $this->event_start_date;
+ $this->event_rsvp_date = ( !empty($_POST['event_rsvp_date']) && preg_match('/^d{4}-d{2}-d{2}$/', $_POST['event_rsvp_date']) ) ? sanitize_text_field($_POST['event_rsvp_date']) : $this->event_start_date;
// if no specificed time, default to event start time
if ( empty($_POST['event_rsvp_time']) ) $this->event_rsvp_time = $this->event_start_time;
}
--- a/events-manager/classes/em-phone.php
+++ b/events-manager/classes/em-phone.php
@@ -70,7 +70,9 @@
public static function validate( $value, $options = array() ) {
$phoneUtil = static::get();
try {
- $phone = $phoneUtil->parse( $value ); // we expect a +... number so in theory no region required
+ // Parse against the configured default country, the same region parse() uses, so a stored national-format number (e.g. a value saved before validation was enabled, or an admin profile edit where the E.164 input script hasn't run) validates the way it is displayed instead of throwing for want of a leading "+".
+ $region = !empty($options['country']) ? $options['country'] : em_get_option('dbem_phone_default_country');
+ $phone = $phoneUtil->parse( $value, $region );
if ( $phoneUtil->isValidNumber( $phone ) ) {
return true;
}
--- a/events-manager/em-actions.php
+++ b/events-manager/em-actions.php
@@ -339,7 +339,7 @@
if( !empty($_REQUEST['action']) && in_array($_REQUEST['action'], $booking_actions) && (is_user_logged_in() || (in_array($_REQUEST['action'], $booking_nopriv_actions) && em_get_option('dbem_bookings_anonymous'))) ){
global $EM_Event, $EM_Booking, $EM_Person;
//Load the booking object, with saved booking if requested
- $EM_Booking = ( !empty($_REQUEST['booking_id']) ) ? em_get_booking($_REQUEST['booking_id']) : em_get_booking();
+ $EM_Booking = em_get_booking_request( $_REQUEST['booking_id'] ?? false );
if( !empty($EM_Booking->event_id) ){
//Load the event object, with saved event if requested
$EM_Event = $EM_Booking->get_event();
@@ -677,7 +677,7 @@
}
}elseif( !empty($_REQUEST['action']) && $_REQUEST['action'] == 'booking_add' && !is_user_logged_in() && !em_get_option('dbem_bookings_anonymous')){
global $EM_Booking;
- $EM_Booking = ( !empty($_REQUEST['booking_id']) ) ? em_get_booking($_REQUEST['booking_id']) : em_get_booking();
+ $EM_Booking = em_get_booking_request( $_REQUEST['booking_id'] ?? false );
$EM_Notices->add_error( $EM_Booking->get_option('dbem_booking_feedback_log_in') );
if( defined('DOING_AJAX') ){
$return = array('result'=>false, 'success'=>false, 'message'=> $EM_Booking->get_option('dbem_booking_feedback_log_in'), 'errors'=>$EM_Notices->get_errors());
--- a/events-manager/events-manager.php
+++ b/events-manager/events-manager.php
@@ -1,7 +1,7 @@
<?php
/*
Plugin Name: Events Manager
-Version: 7.4.8
+Version: 7.4.9
Plugin URI: https://wp-events-plugin.com
Description: Event registration and booking management for WordPress. Recurring events, locations, webinars, google maps, rss, ical, booking registration and more!
Author: Pixelite
@@ -30,7 +30,7 @@
// Setting constants
use EMArchetypes;
-define('EM_VERSION', '7.4.8'); //self expanatory, although version currently may not correspond directly with published version number. until 6.0 we're stuck updating 5.999.x
+define('EM_VERSION', '7.4.9'); //self expanatory, although version currently may not correspond directly with published version number. until 6.0 we're stuck updating 5.999.x
define('EM_PRO_MIN_VERSION', '3.9'); //self expanatory
define('EM_PRO_MIN_VERSION_CRITICAL', '3.6.0.2'); //self expanatory
define('EM_FILE', __FILE__); //an absolute path to this directory
--- a/events-manager/templates/forms/event/bookings.php
+++ b/events-manager/templates/forms/event/bookings.php
@@ -187,7 +187,7 @@
<span class="em-booking-date-normal em-datepicker">
<input type="hidden" class="em-date-input em-date-input-start" aria-hidden="true" aria-label="<?php esc_html_e('Booking Cut-Off Date','events-manager'); ?>">
<span class="em-datepicker-data">
- <input type="date" name="event_rsvp_date" value="<?php echo $EM_Event->event_rsvp_date; ?>">
+ <input type="date" name="event_rsvp_date" value="<?php echo esc_attr($EM_Event->event_rsvp_date); ?>">
</span>
</span>
<span class="em-booking-date-recurring">
--- a/events-manager/templates/placeholders/locationmap.php
+++ b/events-manager/templates/placeholders/locationmap.php
@@ -19,7 +19,7 @@
if( em_get_option('dbem_gmap_type') == 'embed' ){
$map_url = $EM_Location->get_google_maps_embed_url();
?>
- <div class="em-location-map-container" style='position:relative; background: #CDCDCD; width: <?php echo $width ?>; height: <?php echo $height ?>;'>
+ <div class="em-location-map-container" style='position:relative; background: #CDCDCD; width: <?php echo esc_attr($width) ?>; height: <?php echo esc_attr($height) ?>;'>
<iframe class="em-location-map" style="width:100%; height:100%; border:0;" src="<?php echo esc_attr($map_url); ?>" allowfullscreen></iframe>
</div>
<?php
--- a/events-manager/templates/tables/events.php
+++ b/events-manager/templates/tables/events.php
@@ -11,30 +11,30 @@
/* @var bool $show_add_new */
/* @var int $limit */
/* @var int $page */
- $url = esc_url(add_query_arg(array('scope' => null, 'status' => null, 'em_search' => null, 'pno' => null, 'admin_mode' => null))); //template for cleaning the link for each view below
+ $url = add_query_arg(array('scope' => null, 'status' => null, 'em_search' => null, 'pno' => null, 'admin_mode' => null)); //template for cleaning the link for each view below
?>
<div class="<?php em_template_classes('events-admin', 'events-admin-list'); ?>">
<form id="posts-filter" action="" method="get" class="input">
<?php
echo $EM_Notices;
//add new button will only appear if called from em_event_admin template tag, or if the $show_add_new var is set
- if(!empty($show_add_new) && current_user_can('edit_events')) echo '<a class="em-button button add-new-h2" href="'.em_add_get_params($_SERVER['REQUEST_URI'],array('action'=>'edit','scope'=>null,'status'=>null,'event_id'=>null, 'success'=>null)).'">'.__('Add New','events-manager').'</a>';
+ if(!empty($show_add_new) && current_user_can('edit_events')) echo '<a class="em-button button add-new-h2" href="'.esc_url( em_add_get_params($_SERVER['REQUEST_URI'],array('action'=>'edit','scope'=>null,'status'=>null,'event_id'=>null, 'success'=>null)) ).'">'.__('Add New','events-manager').'</a>';
?>
<div class="subsubsub">
- <?php $url = esc_url(add_query_arg(array('scope'=>null,'status'=>null,'em_search'=>null,'pno'=>null, 'admin_mode'=>null))); //template for cleaning the link for each view below ?>
- <a href='<?php echo add_query_arg('view', 'future', $url); ?>' <?php echo ( !isset($_GET['view']) ) ? 'class="current"':''; ?>><?php _e ( 'Upcoming', 'events-manager'); ?> <span class="count">(<?php echo $future_count; ?>)</span></a> |
+ <?php $url = add_query_arg(array('scope'=>null,'status'=>null,'em_search'=>null,'pno'=>null, 'admin_mode'=>null)); //template for cleaning the link for each view below ?>
+ <a href='<?php echo esc_url( add_query_arg('view', 'future', $url) ); ?>' <?php echo ( !isset($_GET['view']) ) ? 'class="current"':''; ?>><?php _e ( 'Upcoming', 'events-manager'); ?> <span class="count">(<?php echo $future_count; ?>)</span></a> |
<?php if( $pending_count > 0 ): ?>
- <a href='<?php echo add_query_arg('view', 'pending', $url); ?>' <?php echo ( isset($_GET['view']) && $_GET['view'] == 'pending' ) ? 'class="current"':''; ?>><?php _e ( 'Pending', 'events-manager'); ?> <span class="count">(<?php echo $pending_count; ?>)</span></a> |
+ <a href='<?php echo esc_url( add_query_arg('view', 'pending', $url) ); ?>' <?php echo ( isset($_GET['view']) && $_GET['view'] == 'pending' ) ? 'class="current"':''; ?>><?php _e ( 'Pending', 'events-manager'); ?> <span class="count">(<?php echo $pending_count; ?>)</span></a> |
<?php endif; ?>
<?php if( $draft_count > 0 ): ?>
- <a href='<?php echo add_query_arg('view', 'draft', $url); ?>' <?php echo ( isset($_GET['view']) && $_GET['view'] == 'draft' ) ? 'class="current"':''; ?>><?php _e ( 'Draft', 'events-manager'); ?> <span class="count">(<?php echo $draft_count; ?>)</span></a> |
+ <a href='<?php echo esc_url( add_query_arg('view', 'draft', $url) ); ?>' <?php echo ( isset($_GET['view']) && $_GET['view'] == 'draft' ) ? 'class="current"':''; ?>><?php _e ( 'Draft', 'events-manager'); ?> <span class="count">(<?php echo $draft_count; ?>)</span></a> |
<?php endif; ?>
- <a href='<?php echo add_query_arg('view', 'past', $url); ?>' <?php echo ( isset($_GET['view']) && $_GET['view'] == 'past' ) ? 'class="current"':''; ?>><?php _e ( 'Past Events', 'events-manager'); ?> <span class="count">(<?php echo $past_count; ?>)</span></a>
+ <a href='<?php echo esc_url( add_query_arg('view', 'past', $url) ); ?>' <?php echo ( isset($_GET['view']) && $_GET['view'] == 'past' ) ? 'class="current"':''; ?>><?php _e ( 'Past Events', 'events-manager'); ?> <span class="count">(<?php echo $past_count; ?>)</span></a>
<?php if( current_user_can('edit_others_events') ): ?>
<div class="admin-events-filter">
- <a href='<?php echo add_query_arg('admin_mode', 1, $url); ?>' <?php echo ( !empty($_GET['admin_mode']) ) ? 'class="current"':''; ?>><?php esc_html_e ( 'All Events', 'events-manager'); ?></a> |
- <a href='<?php echo add_query_arg('admin_mode', null, $url); ?>' <?php echo ( empty($_GET['admin_mode']) ) ? 'class="current"':''; ?>><?php esc_html_e ( 'My Events', 'events-manager'); ?></a>
+ <a href='<?php echo esc_url( add_query_arg('admin_mode', 1, $url) ); ?>' <?php echo ( !empty($_GET['admin_mode']) ) ? 'class="current"':''; ?>><?php esc_html_e ( 'All Events', 'events-manager'); ?></a> |
+ <a href='<?php echo esc_url( add_query_arg('admin_mode', null, $url) ); ?>' <?php echo ( empty($_GET['admin_mode']) ) ? 'class="current"':''; ?>><?php esc_html_e ( 'My Events', 'events-manager'); ?></a>
</div>
<?php endif; ?>
</div>
--- a/events-manager/templates/tables/locations.php
+++ b/events-manager/templates/tables/locations.php
@@ -9,21 +9,21 @@
/* @var int $limit */
/* @var int $page */
/* @var int $offset */
- $url = esc_url(add_query_arg(array('scope'=>null,'status'=>null,'location_id'=>null)));
+ $url = add_query_arg(array('scope'=>null,'status'=>null,'location_id'=>null));
?>
<div class="<?php em_template_classes('locations-admin'); ?> em-locations-admin-list">
<?php if(!is_admin()) echo $EM_Notices; ?>
<form id='locations-filter' method='post' action='' class="input">
<?php
//add new button will only appear if called from em_location_admin template tag, or if the $show_add_new var is set
- if(!empty($show_add_new) && current_user_can('edit_locations')) echo '<a class="em-button button add-new-h2" href="'.add_query_arg('action', 'edit', $url).'">'.__('Add New','events-manager').'</a>';
+ if(!empty($show_add_new) && current_user_can('edit_locations')) echo '<a class="em-button button add-new-h2" href="'.esc_url( add_query_arg('action', 'edit', $url) ).'">'.__('Add New','events-manager').'</a>';
?>
<input type='hidden' name='pno' value='<?php echo esc_attr($page) ?>' />
<div class="subsubsub">
- <a href='<?php echo add_query_arg(array('view'=>null, 'pno'=>null), $url); ?>' <?php echo ( empty($_REQUEST['view']) ) ? 'class="current"':''; ?>><?php echo sprintf( __( 'My %s', 'events-manager'), __('Locations','events-manager')); ?> <span class="count">(<?php echo $locations_mine_count; ?>)</span></a>
+ <a href='<?php echo esc_url( add_query_arg(array('view'=>null, 'pno'=>null), $url) ); ?>' <?php echo ( empty($_REQUEST['view']) ) ? 'class="current"':''; ?>><?php echo sprintf( __( 'My %s', 'events-manager'), __('Locations','events-manager')); ?> <span class="count">(<?php echo $locations_mine_count; ?>)</span></a>
<?php if( current_user_can('read_others_locations') ): ?>
|
- <a href='<?php echo add_query_arg(array('view'=>'others', 'pno'=>null), $url); ?>' <?php echo ( !empty($_REQUEST['view']) && $_REQUEST['view'] == 'others' ) ? 'class="current"':''; ?>><?php echo sprintf( __( 'All %s', 'events-manager'), __('Locations','events-manager')); ?><span class="count">(<?php echo $locations_all_count; ?>)</span></a>
+ <a href='<?php echo esc_url( add_query_arg(array('view'=>'others', 'pno'=>null), $url) ); ?>' <?php echo ( !empty($_REQUEST['view']) && $_REQUEST['view'] == 'others' ) ? 'class="current"':''; ?>><?php echo sprintf( __( 'All %s', 'events-manager'), __('Locations','events-manager')); ?><span class="count">(<?php echo $locations_all_count; ?>)</span></a>
<?php endif; ?>
</div>
<?php if ( $locations_count > 0 ) : ?>
--- a/events-manager/templates/templates/bookings-event-printable.php
+++ b/events-manager/templates/templates/bookings-event-printable.php
@@ -32,11 +32,11 @@
?>
<tr>
- <td><?php echo $EM_Booking->person->get_name() ?></td>
- <td><?php echo $EM_Booking->person->user_email ?></td>
- <td><?php echo $EM_Booking->person->phone ?></td>
+ <td><?php echo esc_html($EM_Booking->person->get_name()) ?></td>
+ <td><?php echo esc_html($EM_Booking->person->user_email) ?></td>
+ <td><?php echo esc_html($EM_Booking->person->phone) ?></td>
<td class='spaces-number'><?php echo $EM_Booking->get_spaces() ?></td>
- <td><?php echo $EM_Booking->booking_comment ?></td>
+ <td><?php echo esc_html($EM_Booking->booking_comment) ?></td>
</tr>
<?php }} ?>
<tr id='booked-spaces'>
--- a/events-manager/templates/templates/search/categories.php
+++ b/events-manager/templates/templates/search/categories.php
@@ -9,8 +9,8 @@
<label for="em-search-category-<?php echo absint($args['id']) ?>" class="screen-reader-text"><?php echo esc_html($args['category_label']); ?></label>
<select name="category[]" class="em-search-category em-selectize <?php echo $args['search_multiselect_style']; ?> checkboxes" id="em-search-category-<?php echo absint($args['id']) ?>" multiple
- data-default="<?php echo $args['categories_label']; ?>"
- data-label="<?php echo $args['category_label']; ?>"
+ data-default="<?php echo esc_attr($args['categories_label']); ?>"
+ data-label="<?php echo esc_attr($args['category_label']); ?>"
data-clear-text="<?php echo esc_attr($args['categories_clear_text']); ?>"
data-selected-text="<?php echo esc_attr($args['categories_count_text']); ?>"
placeholder="<?php echo esc_attr($args['categories_placeholder']); ?>">
--- a/events-manager/templates/templates/search/form-sort.php
+++ b/events-manager/templates/templates/search/form-sort.php
@@ -7,7 +7,7 @@
?>
<div class="em-search-sort" aria-label="<?php esc_attr_e('Sorting Order', 'events-manager'); ?>">
<div class="em-search-sort-trigger" id="em-search-sort-trigger-<?php echo $id; ?>">
- <button type="button" class="em-search-sort-option em-clickable em-search-sort-type-<?php echo $args['order']; ?>" data-sort="<?php echo esc_attr($args['order']); ?>"><?php esc_attr_e('Sorting Order', 'events-manager'); ?></button>
- <input name="order" type="hidden" value="<?php echo $args['order']; ?>">
+ <button type="button" class="em-search-sort-option em-clickable em-search-sort-type-<?php echo esc_attr($args['order']); ?>" data-sort="<?php echo esc_attr($args['order']); ?>"><?php esc_attr_e('Sorting Order', 'events-manager'); ?></button>
+ <input name="order" type="hidden" value="<?php echo esc_attr($args['order']); ?>">
</div>
</div>
No newline at end of file
--- a/events-manager/templates/templates/search/form-views.php
+++ b/events-manager/templates/templates/search/form-views.php
@@ -6,7 +6,7 @@
<div class="em-search-views" aria-label="<?php esc_attr_e('View Types', 'events-manager'); ?>">
<?php $search_views = em_get_search_views(); ?>
<div class="em-search-views-trigger" data-template="em-search-views-options-<?php echo $id; ?>">
- <button type="button" class="em-search-view-option em-clickable em-search-view-type-<?php echo $args['view']; ?>" data-view="<?php echo esc_attr($args['view']); ?>"><?php echo esc_html($search_views[$args['view']]['name']); ?></button>
+ <button type="button" class="em-search-view-option em-clickable em-search-view-type-<?php echo esc_attr($args['view']); ?>" data-view="<?php echo esc_attr($args['view']); ?>"><?php echo esc_html($search_views[$args['view']]['name']); ?></button>
</div>
<div class="em-search-views-options input" id="em-search-views-options-<?php echo $id; ?>">
<fieldset class="em-search-views-options-list" id="em-search-views-options-select-<?php echo $id; ?>">
@@ -21,5 +21,5 @@
</div>
</div>
<?php else: ?>
- <input name="view" type="hidden" value="<?php echo $args['view']; ?>">
+ <input name="view" type="hidden" value="<?php echo esc_attr($args['view']); ?>">
<?php endif; ?>
No newline at end of file
--- a/events-manager/templates/templates/search/tags.php
+++ b/events-manager/templates/templates/search/tags.php
@@ -8,8 +8,8 @@
<label for="em-search-tag-<?php echo absint($args['id']) ?>" class="screen-reader-text"><?php echo esc_html($args['tag_label']); ?></label>
<select name="tag[]" class="em-search-tag em-selectize checkboxes <?php echo $args['search_multiselect_style']; ?>" id="em-search-tag-<?php echo absint($args['id']) ?>" multiple size="10"
- data-default="<?php echo $args['tags_label']; ?>"
- data-label="<?php echo $args['tag_label']; ?>"
+ data-default="<?php echo esc_attr($args['tags_label']); ?>"
+ data-label="<?php echo esc_attr($args['tag_label']); ?>"
data-clear-text="<?php echo esc_attr($args['tags_clear_text']); ?>"
data-count-text="<?php echo esc_attr($args['tags_count_text']); ?>"
placeholder="<?php echo esc_html($args['tags_placeholder']); ?>">