Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/wpdirectorykit/application/controllers/Wdk_fields.php
+++ b/wpdirectorykit/application/controllers/Wdk_fields.php
@@ -4,11 +4,18 @@
class Wdk_fields extends Winter_MVC_Controller {
public function __construct(){
+
+ if ( ! current_user_can('administrator') ) {
+ wp_die( __('You do not have sufficient permissions to access this page.') );
+ }
+
parent::__construct();
}
public function index()
{
+
+
$this->load->model('field_m');
$this->data['fields'] = $this->field_m->get();
--- a/wpdirectorykit/application/controllers/Wdk_frontendajax.php
+++ b/wpdirectorykit/application/controllers/Wdk_frontendajax.php
@@ -34,6 +34,15 @@
$listing = $this->load->listing_m->get($listing_post_id, TRUE);
+
+ /* protect check */
+ if (
+ !wdk_field_value('is_activated', $listing, false) || !wdk_field_value('is_approved', $listing,false)
+ ) {
+ $data['popup_content'] = __( 'Listing is not public', 'wpdirectorykit' );
+ $this->output($data);
+ }
+
$popup_layout = 'result_item_card';
if(!empty($_POST['custom_layout_id'])) {
$popup_layout = (int) sanitize_text_field($_POST['custom_layout_id']);
@@ -751,7 +760,6 @@
$db_results_total = $this->$model_name->total($where, NULL, $like);
$db_results = $this->$model_name->get_pagination($limit,$offset, $where, NULL, $like);
- $data['output'] = $db_results;
if (!$db_results) {
$data['errors'] = '';
--- a/wpdirectorykit/application/helpers/Basic.php
+++ b/wpdirectorykit/application/helpers/Basic.php
@@ -1671,7 +1671,7 @@
if(isset($_GET_clone['order_by']))
{
$_GET_clone['order_by'] = str_replace('post_id', $WMVC->db->prefix.'wdk_messages.post_id', $_GET_clone['order_by']);
- $WMVC->db->order_by(wdk_esc_sql(sanitize_text_field($_GET_clone['order_by'])));
+ $WMVC->db->order_by(wdk_esc_sql(sanitize_text_field($_GET_clone['order_by']), true));
}
}
@@ -3284,7 +3284,7 @@
$ids = array();
foreach($selected as $selected_item) {
if(!empty($selected_item)) {
- $ids [] = $selected_item;
+ $ids [] = (int) $selected_item;
}
}
@@ -5298,8 +5298,8 @@
}
if(!function_exists('wdk_esc_sql')) {
- function wdk_esc_sql ($value = '') {
- return esc_sql(trim(preg_replace([
+ function wdk_esc_sql($value = '', $strict = false) {
+ $patterns = [
'/bselectb/i',
'/binsertb/i',
'/bupdateb/i',
@@ -5315,12 +5315,26 @@
'/--/',
'/#/i',
'//*/',
-
+
// EXTRA BLOCK YOU REQUESTED
'/\\/', // remove backslash
'/|/', // remove |
'/%/', // remove %
- ], '', sanitize_text_field($value))));
+ ];
+
+ // If strict mode is enabled, block additional patterns
+ if ($strict === true) {
+ $strict_patterns = [
+ '/bifbs*(/i',
+ '/bordb/i',
+ '/bsubstrs*(/i',
+ '/bschemas*()/i',
+ '/@@version/i',
+ ];
+ $patterns = array_merge($patterns, $strict_patterns);
+ }
+
+ return esc_sql(trim(preg_replace($patterns, '', sanitize_text_field($value))));
}
}
--- a/wpdirectorykit/elementor-elements/classes/wdk-categories-carousel.php
+++ b/wpdirectorykit/elementor-elements/classes/wdk-categories-carousel.php
@@ -131,7 +131,7 @@
$categories_ids = array();
foreach($this->data['settings']['conf_custom_results'] as $category) {
if(isset($category['category_id']) && !empty($category['category_id'])) {
- $categories_ids [] = $category['category_id'];
+ $categories_ids [] = (int)$category['category_id'];
}
}
@@ -150,7 +150,7 @@
} else {
$order_by = NULL;
if(!empty($this->data['settings']['conf_order_by']))
- $order_by = $this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'];
+ $order_by = wdk_esc_sql($this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'], true);
$where = array();
if (!empty($this->data['settings']['only_root_enable']) && $this->data['settings']['only_root_enable'] == 'yes') {
--- a/wpdirectorykit/elementor-elements/classes/wdk-categories-grid-cover.php
+++ b/wpdirectorykit/elementor-elements/classes/wdk-categories-grid-cover.php
@@ -138,7 +138,7 @@
$categories_ids = array();
foreach($this->data['settings']['conf_custom_results'] as $category) {
if(isset($category['category_id']) && !empty($category['category_id'])) {
- $categories_ids [] = $category['category_id'];
+ $categories_ids [] = (int)$category['category_id'];
}
}
@@ -165,7 +165,7 @@
} else {
$where = array();
if (!empty($this->data['settings']['conf_order_by'])) {
- $order_by = $this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'];
+ $order_by = wdk_esc_sql($this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'], true);
}
if (!empty($this->data['settings']['only_root_enable']) && $this->data['settings']['only_root_enable'] == 'yes') {
--- a/wpdirectorykit/elementor-elements/classes/wdk-categories-grid.php
+++ b/wpdirectorykit/elementor-elements/classes/wdk-categories-grid.php
@@ -131,7 +131,7 @@
$categories_ids = array();
foreach($this->data['settings']['conf_custom_results'] as $category) {
if(isset($category['category_id']) && !empty($category['category_id'])) {
- $categories_ids [] = $category['category_id'];
+ $categories_ids [] = (int)$category['category_id'];
}
}
@@ -150,7 +150,7 @@
} else {
$order_by = NULL;
if(!empty($this->data['settings']['conf_order_by']))
- $order_by = $this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'];
+ $order_by = wdk_esc_sql($this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'], true);
$where = array();
if (!empty($this->data['settings']['only_root_enable']) && $this->data['settings']['only_root_enable'] == 'yes') {
--- a/wpdirectorykit/elementor-elements/classes/wdk-categories-list.php
+++ b/wpdirectorykit/elementor-elements/classes/wdk-categories-list.php
@@ -130,7 +130,7 @@
$categories_ids = array();
foreach($this->data['settings']['conf_custom_results'] as $category) {
if(isset($category['category_id']) && !empty($category['category_id'])) {
- $categories_ids [] = $category['category_id'];
+ $categories_ids [] = (int)$category['category_id'];
}
}
@@ -149,7 +149,7 @@
} else {
$order_by = NULL;
if(!empty($this->data['settings']['conf_order_by']))
- $order_by = $this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'];
+ $order_by = wdk_esc_sql($this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'], true);
$where = array();
--- a/wpdirectorykit/elementor-elements/classes/wdk-categories-tree-top.php
+++ b/wpdirectorykit/elementor-elements/classes/wdk-categories-tree-top.php
@@ -133,7 +133,7 @@
$categories_ids = array();
foreach($this->data['settings']['primary_conf_custom_results'] as $category) {
if(isset($category['category_id']) && !empty($category['category_id'])) {
- $categories_ids [] = $category['category_id'];
+ $categories_ids [] = (int)$category['category_id'];
}
}
/* where in */
@@ -170,7 +170,7 @@
$categories_ids = array();
foreach($this->data['settings']['secondary_conf_custom_results'] as $category) {
if(isset($category['category_id']) && !empty($category['category_id'])) {
- $categories_ids [] = $category['category_id'];
+ $categories_ids [] = (int)$category['category_id'];
}
}
/* where in */
--- a/wpdirectorykit/elementor-elements/classes/wdk-locations-carousel.php
+++ b/wpdirectorykit/elementor-elements/classes/wdk-locations-carousel.php
@@ -131,7 +131,7 @@
$locations_ids = array();
foreach($this->data['settings']['conf_custom_results'] as $location) {
if(isset($location['location_id']) && !empty($location['location_id'])) {
- $locations_ids [] = $location['location_id'];
+ $locations_ids [] = (int)$location['location_id'];
}
}
@@ -150,7 +150,7 @@
} else {
$order_by = NULL;
if(!empty($this->data['settings']['conf_order_by']))
- $order_by = $this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'];
+ $order_by = wdk_esc_sql($this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'], true);
$where = array();
if (!empty($this->data['settings']['only_root_enable']) && $this->data['settings']['only_root_enable'] == 'yes') {
--- a/wpdirectorykit/elementor-elements/classes/wdk-locations-grid-cover.php
+++ b/wpdirectorykit/elementor-elements/classes/wdk-locations-grid-cover.php
@@ -138,7 +138,7 @@
$locations_ids = array();
foreach($this->data['settings']['conf_custom_results'] as $location) {
if(isset($location['location_id']) && !empty($location['location_id'])) {
- $locations_ids [] = $location['location_id'];
+ $locations_ids [] = (int)$location['location_id'];
}
}
@@ -165,7 +165,7 @@
} else {
$where = array();
if (!empty($this->data['settings']['conf_order_by'])) {
- $order_by = wdk_esc_sql($this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order']);
+ $order_by = wdk_esc_sql($this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'], true);
}
if (!empty($this->data['settings']['only_root_enable']) && $this->data['settings']['only_root_enable'] == 'yes') {
--- a/wpdirectorykit/elementor-elements/classes/wdk-locations-grid.php
+++ b/wpdirectorykit/elementor-elements/classes/wdk-locations-grid.php
@@ -132,7 +132,7 @@
$locations_ids = array();
foreach($this->data['settings']['conf_custom_results'] as $location) {
if(isset($location['location_id']) && !empty($location['location_id'])) {
- $locations_ids [] = $location['location_id'];
+ $locations_ids [] = (int)$location['location_id'];
}
}
@@ -151,7 +151,7 @@
} else {
$order_by = NULL;
if(!empty($this->data['settings']['conf_order_by']))
- $order_by = wdk_esc_sql($this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order']);
+ $order_by = wdk_esc_sql($this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'], true);
$where = array();
if (!empty($this->data['settings']['only_root_enable']) && $this->data['settings']['only_root_enable'] == 'yes') {
$where['('.$this->WMVC->{$controller.'_m'}->_table_name.'.level = 0)'] = NULL;
--- a/wpdirectorykit/elementor-elements/classes/wdk-locations-list.php
+++ b/wpdirectorykit/elementor-elements/classes/wdk-locations-list.php
@@ -131,7 +131,7 @@
$locations_ids = array();
foreach($this->data['settings']['conf_custom_results'] as $location) {
if(isset($location['location_id']) && !empty($location['location_id'])) {
- $locations_ids [] = $location['location_id'];
+ $locations_ids [] = (int)$location['location_id'];
}
}
@@ -150,7 +150,7 @@
} else {
$order_by = NULL;
if(!empty($this->data['settings']['conf_order_by']))
- $order_by = $this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'];
+ $order_by = wdk_esc_sql($this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'], true);
$where = array();
if (!empty($this->data['settings']['only_root_enable']) && $this->data['settings']['only_root_enable'] == 'yes') {
--- a/wpdirectorykit/elementor-elements/views/wdk-categories-grid-cover.php
+++ b/wpdirectorykit/elementor-elements/views/wdk-categories-grid-cover.php
@@ -45,20 +45,20 @@
<div class="wdk-col">
<div class="wdk-categories-card-cover">
<?php if(wmvc_show_data('layout_image_type', $settings) == 'icon'):?>
- <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo wmvc_show_data('category_title', $value);?>" class="wdk-icon">
+ <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>" class="wdk-icon">
<?php else:?>
- <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id', 'image_path'));?>" alt="<?php echo wmvc_show_data('category_title', $value);?>" class="wdk-image">
+ <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id', 'image_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>" class="wdk-image">
<?php endif;?>
<div class="wdk-categories-card-body">
<div class="wdk-action-left">
<?php if(wmvc_show_data('content_icon_type', $settings) == 'image' && wdk_image_src($value, 'full', NULL,'icon_id')):?>
- <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo wmvc_show_data('category_title', $value);?>">
+ <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>">
<?php elseif(wmvc_show_data('content_icon_type', $settings) == 'font'):?>
<i class="<?php echo wmvc_show_data('font_icon_code', $value,'');?>"></i>
<?php endif;?>
</div>
<div class="wdk-left-content">
- <h3 class="wdk-title"><?php echo wmvc_show_data('category_title', $value);?></h3>
+ <h3 class="wdk-title"><?php echo esc_html(wmvc_show_data('category_title', $value));?></h3>
<span class="wdk-listings-count">
<?php
echo esc_html(wdk_sprintf(_nx(
--- a/wpdirectorykit/elementor-elements/views/wdk-categories-grid.php
+++ b/wpdirectorykit/elementor-elements/views/wdk-categories-grid.php
@@ -44,12 +44,12 @@
<div class="wdk-categories-card">
<div class="wdk-thumbnail">
<?php if(wmvc_show_data('layout_image_type', $settings) == 'icon'):?>
- <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo wmvc_show_data('category_title', $value);?>" class="wdk-icon">
+ <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>" class="wdk-icon">
<?php else:?>
- <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id','image_path'));?>" alt="<?php echo wmvc_show_data('category_title', $value);?>" class="wdk-image">
+ <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id','image_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>" class="wdk-image">
<?php endif;?>
</div>
- <h3 class="wdk-title"><?php echo wmvc_show_data('category_title', $value);?></h3>
+ <h3 class="wdk-title"><?php echo esc_html(wmvc_show_data('category_title', $value));?></h3>
<a href="<?php echo esc_url(wdk_url_suffix($results_page,'search_category='.wmvc_show_data('idcategory', $value)));?>#results" class="wdk-link"></a>
</div>
<?php if(wmvc_show_data('layout_carousel_enable', $settings) != 'yes'):?>
--- a/wpdirectorykit/elementor-elements/views/wdk-categories-list.php
+++ b/wpdirectorykit/elementor-elements/views/wdk-categories-list.php
@@ -37,7 +37,7 @@
class="wdk-link <?php if(wmvc_show_data('enable_search_sensitive', $settings)):?> wdk-search_sensitive_link <?php endif;?> ">
<?php if(wmvc_show_data('show_icon', $settings) == 'true'):?>
<?php if(wmvc_show_data('icon_id', $value, false)):?>
- <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id','icon_path'));?>" alt="<?php echo wmvc_show_data('category_title', $value);?>" class="wdk-icon">
+ <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id','icon_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>" class="wdk-icon">
<?php endif;?>
<?php else:?>
<?php ElementorIcons_Manager::render_icon( $settings['item_icon_i'], [ 'aria-hidden' => 'true' ] );?>
--- a/wpdirectorykit/elementor-elements/views/wdk-categories-tree-top.php
+++ b/wpdirectorykit/elementor-elements/views/wdk-categories-tree-top.php
@@ -36,7 +36,7 @@
<div class="wdk-col">
<div class="category-card">
<div class="body">
- <h3 class="title"><?php echo wmvc_show_data('category_title', $value);?></h3>
+ <h3 class="title"><?php echo esc_html(wmvc_show_data('category_title', $value));?></h3>
<div class="sub">
<?php
echo esc_html(wdk_sprintf(_nx(
@@ -51,9 +51,9 @@
</div>
<div class="thumbnail">
<?php if(wmvc_show_data('primary_layout_image_type', $settings) == 'icon'):?>
- <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo wmvc_show_data('category_title', $value);?>" class="wdk-icon">
+ <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>" class="wdk-icon">
<?php elseif(wmvc_show_data('primary_layout_image_type', $settings) == 'image'):?>
- <img class="jsplaceholder" onerror="this.src = '<?php echo esc_url(wdk_placeholder_image_src());?>';" src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id','image_path'));?>" alt="<?php echo wmvc_show_data('category_title', $value);?>" class="wdk-image">
+ <img class="jsplaceholder" onerror="this.src = '<?php echo esc_url(wdk_placeholder_image_src());?>';" src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id','image_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>" class="wdk-image">
<?php elseif(wmvc_show_data('primary_layout_image_type', $settings) == 'font_icon'):?>
<span class="wdk-font-icon" style="background-color: <?php echo esc_attr(wmvc_show_data('category_color', $value));?>;"><i class="<?php echo esc_attr(wmvc_show_data('font_icon_code', $value));?>"></i></span>
<?php endif;?>
@@ -72,7 +72,7 @@
<div class="wdk-col">
<div class="category-card">
<div class="body">
- <h3 class="title"><?php echo wmvc_show_data('category_title', $value);?></h3>
+ <h3 class="title"><?php echo esc_html(wmvc_show_data('category_title', $value));?></h3>
<div class="sub">
<?php
echo esc_html(wdk_sprintf(_nx(
@@ -87,9 +87,9 @@
</div>
<div class="thumbnail">
<?php if(wmvc_show_data('secondary_layout_image_type', $settings) == 'icon'):?>
- <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo wmvc_show_data('category_title', $value);?>" class="wdk-icon">
+ <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>" class="wdk-icon">
<?php elseif(wmvc_show_data('secondary_layout_image_type', $settings) == 'image'):?>
- <img class="jsplaceholder" onerror="this.src = '<?php echo esc_url(wdk_placeholder_image_src());?>';" src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id','image_path'));?>" alt="<?php echo wmvc_show_data('category_title', $value);?>" class="wdk-image">
+ <img class="jsplaceholder" onerror="this.src = '<?php echo esc_url(wdk_placeholder_image_src());?>';" src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id','image_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>" class="wdk-image">
<?php elseif(wmvc_show_data('secondary_layout_image_type', $settings) == 'font_icon'):?>
<span class="wdk-font-icon" style="background-color: <?php echo esc_attr(wmvc_show_data('category_color', $value));?>;"><i class="<?php echo esc_attr(wmvc_show_data('font_icon_code', $value));?>"></i></span>
<?php endif;?>
--- a/wpdirectorykit/elementor-elements/views/wdk-categories-tree.php
+++ b/wpdirectorykit/elementor-elements/views/wdk-categories-tree.php
@@ -77,18 +77,18 @@
<?php if(wmvc_show_data('show_icon', $settings) == 'yes'):?>
<?php if(wmvc_show_data('layout_image_type', $settings) == 'icon'):?>
<a href="<?php echo esc_url(wdk_url_suffix($results_page,'search_category='.wmvc_show_data('idcategory', $value)));?>#results">
- <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo wmvc_show_data('category_title', $value);?>" class="wdk-icon">
+ <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>" class="wdk-icon">
</a>
<?php elseif(wmvc_show_data('layout_image_type', $settings) == 'image'):?>
<a class="wdk-d-block" href="<?php echo esc_url(wdk_url_suffix($results_page,'search_category='.wmvc_show_data('idcategory', $value)));?>#results">
- <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id','image_path'));?>" alt="<?php echo wmvc_show_data('category_title', $value);?>" class="wdk-image">
+ <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id','image_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>" class="wdk-image">
</a>
<?php elseif(wmvc_show_data('layout_image_type', $settings) == 'font_icon'):?>
<span class="wdk-font-icon" style="background-color: <?php echo esc_attr(wmvc_show_data('category_color', $value));?>;"><i class="<?php echo esc_attr(wmvc_show_data('font_icon_code', $value));?>"></i></span>
<?php endif;?>
<?php endif;?>
<a href="<?php echo esc_url(wdk_url_suffix($results_page,'search_category='.wmvc_show_data('idcategory', $value)));?>#results" class="title-in">
- <?php echo wmvc_show_data('category_title', $value);?>
+ <?php echo esc_html(wmvc_show_data('category_title', $value));?>
</a>
</h3>
<ul class="wdk-categories">
@@ -114,7 +114,7 @@
<li class="wdk-item <?php echo ($categories_sub_count > wmvc_show_data('conf_limit_sub', $settings)) ? 'more-sub' : '';?>" <?php echo ($categories_sub_count > wmvc_show_data('conf_limit_sub', $settings)) ? 'style="display: none;"' : '';?>>
<a href="<?php echo esc_url(wdk_url_suffix($results_page,'search_category='.wmvc_show_data('idcategory', $value)));?>#results" class="wdk-link">
<?php ElementorIcons_Manager::render_icon( $settings['item_icon_i'], [ 'aria-hidden' => 'true' ] );?>
- <span class="wdk-title"><?php echo wmvc_show_data('category_title', $value);?></span>
+ <span class="wdk-title"><?php echo esc_html(wmvc_show_data('category_title', $value));?></span>
<span class="wdk-count"><?php echo wmvc_show_data('listings_counter', $value, 0);?></span>
</a>
</li>
--- a/wpdirectorykit/elementor-elements/views/wdk-locations-grid-cover.php
+++ b/wpdirectorykit/elementor-elements/views/wdk-locations-grid-cover.php
@@ -37,20 +37,20 @@
<div class="wdk-col">
<div class="wdk-locations-card-cover">
<?php if(wmvc_show_data('layout_image_type', $settings) == 'icon'):?>
- <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo wmvc_show_data('location_title', $value);?>" class="wdk-icon">
+ <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('location_title', $value));?>" class="wdk-icon">
<?php else:?>
- <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id', 'image_path'));?>" alt="<?php echo wmvc_show_data('location_title', $value);?>" class="wdk-image">
+ <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id', 'image_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('location_title', $value));?>" class="wdk-image">
<?php endif;?>
<div class="wdk-locations-card-body">
<div class="wdk-action-left">
<?php if(wmvc_show_data('content_icon_type', $settings) == 'image' && wdk_image_src($value, 'full', NULL,'icon_id')):?>
- <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo wmvc_show_data('category_title', $value);?>">
+ <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>">
<?php elseif(wmvc_show_data('content_icon_type', $settings) == 'font'):?>
<i class="<?php echo wmvc_show_data('font_icon_code', $value,'');?>"></i>
<?php endif;?>
</div>
<div class="wdk-left-content">
- <h3 class="wdk-title"><?php echo wmvc_show_data('location_title', $value);?></h3>
+ <h3 class="wdk-title"><?php echo esc_html(wmvc_show_data('location_title', $value));?></h3>
<span class="wdk-listings-count">
<?php
echo esc_html(wdk_sprintf(_nx(
--- a/wpdirectorykit/elementor-elements/views/wdk-locations-grid.php
+++ b/wpdirectorykit/elementor-elements/views/wdk-locations-grid.php
@@ -39,12 +39,12 @@
<div class="wdk-locations-card">
<div class="wdk-thumbnail">
<?php if(wmvc_show_data('layout_image_type', $settings) == 'icon'):?>
- <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo wmvc_show_data('location_title', $value);?>" class="wdk-icon">
+ <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('location_title', $value));?>" class="wdk-icon">
<?php else:?>
- <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id', 'image_path'));?>" alt="<?php echo wmvc_show_data('location_title', $value);?>" class="wdk-image">
+ <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id', 'image_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('location_title', $value));?>" class="wdk-image">
<?php endif;?>
</div>
- <h3 class="wdk-title"><?php echo wmvc_show_data('location_title', $value);?></h3>
+ <h3 class="wdk-title"><?php echo esc_html(wmvc_show_data('location_title', $value));?></h3>
<a href="<?php echo esc_url(wdk_url_suffix($results_page,'search_location='.wmvc_show_data('idlocation', $value)));?>#results" class="wdk-link"></a>
</div>
</div>
--- a/wpdirectorykit/elementor-elements/views/wdk-locations-list.php
+++ b/wpdirectorykit/elementor-elements/views/wdk-locations-list.php
@@ -39,7 +39,7 @@
class="wdk-link <?php if(wmvc_show_data('enable_search_sensitive', $settings)):?> wdk-search_sensitive_link <?php endif;?>">
<?php if(wmvc_show_data('show_icon', $settings) == 'true'):?>
<?php if(wmvc_show_data('icon_id', $value, false)):?>
- <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo wmvc_show_data('location_title', $value);?>" class="wdk-icon">
+ <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('location_title', $value));?>" class="wdk-icon">
<?php endif;?>
<?php else:?>
<?php ElementorIcons_Manager::render_icon( $settings['item_icon_i'], [ 'aria-hidden' => 'true' ] );?>
--- a/wpdirectorykit/elementor-elements/views/wdk-locations-tree.php
+++ b/wpdirectorykit/elementor-elements/views/wdk-locations-tree.php
@@ -63,18 +63,18 @@
<?php if(wmvc_show_data('show_icon', $settings) == 'yes'):?>
<?php if(wmvc_show_data('layout_image_type', $settings) == 'icon'):?>
<a href="<?php echo esc_url(wdk_url_suffix($results_page,'search_location='.wmvc_show_data('idlocation', $value)));?>#results">
- <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo wmvc_show_data('location_title', $value);?>" class="wdk-icon">
+ <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('location_title', $value));?>" class="wdk-icon">
</a>
<?php elseif(wmvc_show_data('layout_image_type', $settings) == 'image'):?>
<a class="wdk-d-block" href="<?php echo esc_url(wdk_url_suffix($results_page,'search_location='.wmvc_show_data('idlocation', $value)));?>#results">
- <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id','image_path'));?>" alt="<?php echo wmvc_show_data('location_title', $value);?>" class="wdk-image">
+ <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id','image_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('location_title', $value));?>" class="wdk-image">
</a>
<?php elseif(wmvc_show_data('layout_image_type', $settings) == 'font_icon'):?>
<span class="wdk-font-icon" style="background-color: <?php echo esc_attr(wmvc_show_data('location_color', $value));?>;"><i class="<?php echo esc_attr(wmvc_show_data('font_icon_code', $value));?>"></i></span>
<?php endif;?>
<?php endif;?>
<a href="<?php echo esc_url(wdk_url_suffix($results_page,'search_location='.wmvc_show_data('idlocation', $value)));?>#results" class="title-in">
- <?php echo wmvc_show_data('location_title', $value);?>
+ <?php echo esc_html(wmvc_show_data('location_title', $value));?>
</a>
</h3>
<ul class="wdk-locations">
@@ -83,7 +83,7 @@
<li class="wdk-item">
<a href="<?php echo esc_url(wdk_url_suffix($results_page,'search_location='.wmvc_show_data('idlocation', $value)));?>#results" class="wdk-link">
<?php ElementorIcons_Manager::render_icon( $settings['item_icon_i'], [ 'aria-hidden' => 'true' ] );?>
- <span class="wdk-title"><?php echo wmvc_show_data('location_title', $value);?></span>
+ <span class="wdk-title"><?php echo esc_html(wmvc_show_data('location_title', $value));?></span>
<span class="wdk-count"><?php echo wmvc_show_data('listings_counter', $value, 0);?></span>
</a>
</li>
--- a/wpdirectorykit/filters.php
+++ b/wpdirectorykit/filters.php
@@ -433,7 +433,7 @@
if(!empty($_GET['field_search'])) {
global $Winter_MVC_WDK;
$Winter_MVC_WDK->model('location_m');
- $location = $Winter_MVC_WDK->location_m->get_by(array('location_title'=>wdk_esc_sql(sanitize_text_field(wp_unslash($_GET['field_search'])))), TRUE);
+ $location = $Winter_MVC_WDK->location_m->get_by(array('location_title'=>wdk_esc_sql(sanitize_text_field($_GET['field_search']))), TRUE);
if($location) {
$url = $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
--- a/wpdirectorykit/shortcodes/shortcode-wdk-listing-field-value-prefix.php
+++ b/wpdirectorykit/shortcodes/shortcode-wdk-listing-field-value-prefix.php
@@ -45,6 +45,15 @@
$data['field_value'] = '';
$data['field_prefix'] = '';
$data['field_suffix'] = '';
+
+ /* protect check */
+ if(in_array($data['settings']['field_id'], ['post_password', 'status']) ) {
+ return false;
+ }
+ if(wdk_field_option($data['settings']['field_id'], 'is_visible_frontend') != 1) {
+ return false;
+ }
+
if(!empty($data['settings']['field_id'])){
if(strpos($data['settings']['field_id'],'__') !== FALSE){
$data['settings']['field_id'] = substr($data['settings']['field_id'], strpos($data['settings']['field_id'],'__')+2);
--- a/wpdirectorykit/shortcodes/shortcode-wdk-listing-field-value-suffix.php
+++ b/wpdirectorykit/shortcodes/shortcode-wdk-listing-field-value-suffix.php
@@ -45,6 +45,15 @@
$data['field_value'] = '';
$data['field_suffix'] = '';
$data['field_suffix'] = '';
+
+ /* protect check */
+ if(in_array($data['settings']['field_id'], ['post_password', 'status']) ) {
+ return false;
+ }
+ if(wdk_field_option($data['settings']['field_id'], 'is_visible_frontend') != 1) {
+ return false;
+ }
+
if(!empty($data['settings']['field_id'])){
if(strpos($data['settings']['field_id'],'__') !== FALSE){
$data['settings']['field_id'] = substr($data['settings']['field_id'], strpos($data['settings']['field_id'],'__')+2);
--- a/wpdirectorykit/shortcodes/shortcode-wdk-listing-field-value-text.php
+++ b/wpdirectorykit/shortcodes/shortcode-wdk-listing-field-value-text.php
@@ -46,6 +46,15 @@
$data['field_value'] = '';
$data['field_prefix'] = '';
$data['field_suffix'] = '';
+
+ /* protect check */
+ if(in_array($data['settings']['field_id'], ['post_password', 'status']) ) {
+ return false;
+ }
+ if(wdk_field_option($data['settings']['field_id'], 'is_visible_frontend') != 1) {
+ return false;
+ }
+
if(!empty($data['settings']['field_id'])){
if(strpos($data['settings']['field_id'],'__') !== FALSE){
$data['settings']['field_id'] = substr($data['settings']['field_id'], strpos($data['settings']['field_id'],'__')+2);
--- a/wpdirectorykit/wpdirectorykit.php
+++ b/wpdirectorykit/wpdirectorykit.php
@@ -16,7 +16,7 @@
* Plugin Name: WP Directory Kit
* Plugin URI: https://wpdirectorykit.com/plugins/wpdirectorykit.html
* Description: Build your Directory portal, demos for Real Estate Agencies and Car Dealership included
- * Version: 1.5.5
+ * Version: 1.5.6
* Requires PHP: 7.0
* Author: wpdirectorykit.com
* Author URI: https://wpdirectorykit.com
@@ -42,7 +42,7 @@
* Start at version 1.0.0 and use SemVer - https://semver.org
* Rename this for your plugin and update it as you release new versions.
*/
-define('WPDIRECTORYKIT_VERSION', '1.5.5');
+define('WPDIRECTORYKIT_VERSION', '1.5.6');
define('WPDIRECTORYKIT_NAME', 'wdk');
define('WPDIRECTORYKIT_PATH', plugin_dir_path(__FILE__));
define('WPDIRECTORYKIT_URL', plugin_dir_url(__FILE__));