Skip to content

Commit

Permalink
2.3.49
Browse files Browse the repository at this point in the history
  • Loading branch information
stiofan committed Apr 15, 2024
1 parent 18f4bcc commit 2ccfcc2
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 22 deletions.
4 changes: 2 additions & 2 deletions geodirectory.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: GeoDirectory
* Plugin URI: https://wpgeodirectory.com/
* Description: GeoDirectory - Business Directory Plugin for WordPress.
* Version: 2.3.48
* Version: 2.3.49
* Author: AyeCode - WordPress Business Directory Plugins
* Author URI: https://wpgeodirectory.com
* Text Domain: geodirectory
Expand All @@ -34,7 +34,7 @@ final class GeoDirectory {
*
* @var string
*/
public $version = '2.3.48';
public $version = '2.3.49';

/**
* GeoDirectory instance.
Expand Down
4 changes: 2 additions & 2 deletions includes/api/class-geodir-rest-post-tags-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ public function prepare_item_for_response( $item, $request ) {
if ( ! empty( $schema['properties']['id'] ) ) {
$data['id'] = (int) $item->term_id;
}

if ( ! empty( $schema['properties']['name'] ) ) {
$data['name'] = $item->name;
}

if ( ! empty( $schema['properties']['slug'] ) ) {
$data['slug'] = $item->slug;
}
}

if ( ! empty( $schema['properties']['taxonomy'] ) ) {
$data['taxonomy'] = $this->taxonomy;
Expand Down
10 changes: 5 additions & 5 deletions includes/class-geodir-ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,25 +222,25 @@ public static function manual_map() {

echo geodir_get_template_html( $template, $tmpl_args );
} else {
echo "<style>.lity-show #" . $prefix . "set_address_button,.lity-show .TopLeft,.lity-show .TopRight,.lity-show .BottomRight,.lity-show .BottomLeft{display:none}.lity-show .geodir_map_container{margin-top:0 !important}</style>";
echo "<style>.lity-show #" . esc_attr( $prefix ) . "set_address_button,.lity-show .TopLeft,.lity-show .TopRight,.lity-show .BottomRight,.lity-show .BottomLeft{display:none}.lity-show .geodir_map_container{margin-top:0 !important}</style>";

include_once( GEODIRECTORY_PLUGIN_DIR . 'templates/map.php' );
}
?>
<input type="hidden" id="<?php echo $prefix . 'latitude'; ?>">
<input type="hidden" id="<?php echo $prefix . 'longitude'; ?>">
<input type="hidden" id="<?php echo esc_attr( $prefix ) . 'latitude'; ?>">
<input type="hidden" id="<?php echo esc_attr( $prefix ) . 'longitude'; ?>">
<?php
if( $design_style ) {
?>
<div class="text-right text-end">
<button type="button" class="btn btn-link" data-dismiss="modal"><?php _e("Cancel","geodirectory");?></button>
<button class="btn btn-primary"
onclick="if(jQuery('#<?php echo $prefix . 'latitude'; ?>').val()==''){alert('<?php _e( 'Please drag the marker or the map to set the position.', 'geodirectory' ); ?>');}else{jQuery(window).triggerHandler('<?php echo $prefix; ?>', [jQuery('#<?php echo $prefix . 'latitude'; ?>').val(), jQuery('#<?php echo $prefix . 'longitude'; ?>').val()]);}"><?php _e( 'Set my location', 'geodirectory' ); ?></button>
onclick="if(jQuery('#<?php echo esc_attr( $prefix ) . 'latitude'; ?>').val()==''){alert('<?php _e( 'Please drag the marker or the map to set the position.', 'geodirectory' ); ?>');}else{jQuery(window).triggerHandler('<?php echo esc_attr( $prefix ); ?>', [jQuery('#<?php echo esc_attr( $prefix ) . 'latitude'; ?>').val(), jQuery('#<?php echo esc_attr( $prefix ) . 'longitude'; ?>').val()]);}"><?php _e( 'Set my location', 'geodirectory' ); ?></button>
</div><?php
}else{
?>
<button style="float: right;margin: 10px 0 0 0;"
onclick="if(jQuery('#<?php echo $prefix . 'latitude'; ?>').val()==''){alert('<?php _e( 'Please drag the marker or the map to set the position.', 'geodirectory' ); ?>');}else{jQuery(window).triggerHandler('<?php echo $prefix; ?>', [jQuery('#<?php echo $prefix . 'latitude'; ?>').val(), jQuery('#<?php echo $prefix . 'longitude'; ?>').val()]);}"><?php _e( 'Set my location', 'geodirectory' ); ?></button>
onclick="if(jQuery('#<?php echo esc_attr( $prefix ) . 'latitude'; ?>').val()==''){alert('<?php _e( 'Please drag the marker or the map to set the position.', 'geodirectory' ); ?>');}else{jQuery(window).triggerHandler('<?php echo esc_attr( $prefix ); ?>', [jQuery('#<?php echo esc_attr( $prefix ) . 'latitude'; ?>').val(), jQuery('#<?php echo esc_attr( $prefix ) . 'longitude'; ?>').val()]);}"><?php _e( 'Set my location', 'geodirectory' ); ?></button>
<?php
}
wp_die();
Expand Down
8 changes: 6 additions & 2 deletions includes/widgets/class-geodir-widget-categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,8 @@ public function output( $args = array(), $widget_args = array(), $content = '' )
*/
$options = wp_parse_args( $args, $defaults );

// print_r($args);
// print_r($options);
// sanitize tag
$options['title_tag'] = in_array( $options['title_tag'], array( 'h2', 'h3', 'h4', 'h5', 'h6', 'span' ), true ) ? esc_attr( $options['title_tag'] ) : 'h4';

if ( empty( $options['card_color'] ) ) {
$options['card_color'] = $defaults['card_color'];}
Expand Down Expand Up @@ -788,6 +788,10 @@ public static function categories_output( $params ) {
)
);

// sanitize tag
$args['title_tag'] = in_array( $args['title_tag'], array( 'h2', 'h3', 'h4', 'h5', 'h6', 'span' ), true ) ? esc_attr( $args['title_tag'] ) : 'h4';


$sort_by = isset( $args['sort_by'] ) && in_array( $args['sort_by'], array( 'az', 'count' ) ) ? sanitize_text_field( $args['sort_by'] ) : 'count';
$cpt_filter = empty( $args['no_cpt_filter'] ) ? true : false;
$cat_filter = empty( $args['no_cat_filter'] ) ? true : false;
Expand Down
4 changes: 4 additions & 0 deletions includes/widgets/class-geodir-widget-listings.php
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,10 @@ public function output( $instance = array(), $widget_args = array(), $content =
)
);


// sanitize title_tag
$instance['title_tag'] = in_array( $instance['title_tag'], array( 'h2', 'h3' ), true ) ? esc_attr( $instance['title_tag'] ) : 'h3';

ob_start();

$this->output_html( $widget_args, $instance );
Expand Down
13 changes: 3 additions & 10 deletions includes/widgets/class-geodir-widget-page-title.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,19 +217,12 @@ public function output( $instance = array(), $args = array(), $content = '' ) {
$instance['font_size_class'] = 'h1';
}

// sanitize tag
$instance['tag'] = in_array( $instance['tag'], array( 'h1', 'h2', 'h3', 'div' ), true ) ? esc_attr( $instance['tag'] ) : 'h1';

$design_style = geodir_design_style();
$block_preview = $this->is_block_content_call();
$output = '';
// if ( $this->is_preview() ) {
// return $output;
// }

// No GD page
// if ( ! geodir_is_geodir_page() && !$block_preview ) {
// return;
// }



// Title container class
$container_class = 'geodir-page-title-wrap geodir-page-title-' . sanitize_html_class( $instance['tag'] );
Expand Down
4 changes: 4 additions & 0 deletions includes/widgets/class-geodir-widget-single-tabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,10 @@ public function output( $args = array(), $widget_args = array(), $content = '' )
*/
$args = wp_parse_args( $args, $defaults );

// sanitize heading_tag
$allowed_tags = array( 'h2', 'h3', 'h4' );
$args['heading_tag'] = in_array( $args['heading_tag'], $allowed_tags, true ) ? esc_attr( $args['heading_tag'] ) : 'h2';

// Check if we have been here before
$tabs_array = ! empty( $gd_single_tabs_array ) ? $gd_single_tabs_array : array();

Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://wpgeodirectory.com
Tags: business directory, listings, directory plugin, classifieds, directory
Requires at least: 4.5
Tested up to: 6.5
Stable tag: 2.3.48
Stable tag: 2.3.49
Requires PHP: 5.6
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Expand Down Expand Up @@ -306,6 +306,9 @@ We don't offer free trials, but we have a 30-day money-back guarantee if you are

__WARNING: GDv2 is a significant update over GDv1 and may require manual work, such as adding widgets to sidebars to recreate your current layout. As always, we recommend trying this on a staging site first. [Learn more](https://docs.wpgeodirectory.com/article/260-upgrading-from-gdv1-to-gdv2)__

= GeoDirectory v2.3.49 - 2024-04-15 =
* Extra sanitization for shortcode tag selectors, contributor+ user with details template access could potentially output JS code - FIXED/SECURITY

= GeoDirectory v2.3.48 - 2024-04-11 =
* UK regions can sometime contain "Council", we now remove this by default - CHANGED
* SD and AUI packages updated to latest - UPDATED
Expand Down

0 comments on commit 2ccfcc2

Please sign in to comment.