Google Maps CP - Version 1.0.24

Version Description

  • Fixes an issue processing the maps settings.
Download this release

Release Info

Developer codepeople
Plugin Icon 128x128 Google Maps CP
Version 1.0.24
Comparing to
See all releases

Code changes from version 1.0.23 to 1.0.24

Files changed (3) hide show
  1. codepeople-post-map.php +1 -1
  2. include/functions.php +16 -3
  3. readme.txt +4 -0
codepeople-post-map.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Google Maps CP
4
  Text Domain: codepeople-post-map
5
- Version: 1.0.23
6
  Author: CodePeople
7
  Author URI: http://wordpress.dwbooster.com/content-tools/codepeople-post-map
8
  Plugin URI: http://wordpress.dwbooster.com/content-tools/codepeople-post-map
2
  /*
3
  Plugin Name: Google Maps CP
4
  Text Domain: codepeople-post-map
5
+ Version: 1.0.24
6
  Author: CodePeople
7
  Author URI: http://wordpress.dwbooster.com/content-tools/codepeople-post-map
8
  Plugin URI: http://wordpress.dwbooster.com/content-tools/codepeople-post-map
include/functions.php CHANGED
@@ -82,6 +82,19 @@ class CPM {
82
  );
83
  } // End __construct
84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  function sanitize_html( $v )
86
  {
87
  $allowed_tags = wp_kses_allowed_html( 'post' );
@@ -116,9 +129,9 @@ class CPM {
116
  delete_post_meta($post_id,'cpm_map');
117
 
118
  $new_cpm_point = ( isset( $_POST['cpm_point'] ) ) ? $_POST['cpm_point'] : array();
119
- $new_cpm_map = array_map(array($this, 'sanitize_html'), $new_cpm_point);
120
  $new_cpm_map = ( isset( $_POST['cpm_map'] ) ) ? $_POST['cpm_map'] : array();
121
- $new_cpm_map = array_map('sanitize_text_field', $new_cpm_map);
122
 
123
  $new_cpm_point['icon'] = str_replace( CPM_PLUGIN_URL, '', $default_icon );
124
 
@@ -897,7 +910,7 @@ class CPM {
897
  // Check if post exists and save the configuraton options
898
  if (isset($_POST['cpm_map_noncename']) && wp_verify_nonce($_POST['cpm_map_noncename'],__FILE__)){
899
  $options = $_POST['cpm_map'];
900
- $options = array_map('sanitize_text_field', $options);
901
  $options['drag_map'] = ( isset( $options[ 'drag_map' ] ) ) ? true : false;
902
  $options['windowhtml'] = $this->get_configuration_option('windowhtml');
903
  update_option('cpm_config', $options);
82
  );
83
  } // End __construct
84
 
85
+ function array_map_recursive($callback, $array)
86
+ {
87
+ foreach ($array as $key => $value) {
88
+ if (is_array($array[$key])) {
89
+ $array[$key] = $this->array_map_recursive($callback, $array[$key]);
90
+ }
91
+ else {
92
+ $array[$key] = call_user_func($callback, $array[$key]);
93
+ }
94
+ }
95
+ return $array;
96
+ }
97
+
98
  function sanitize_html( $v )
99
  {
100
  $allowed_tags = wp_kses_allowed_html( 'post' );
129
  delete_post_meta($post_id,'cpm_map');
130
 
131
  $new_cpm_point = ( isset( $_POST['cpm_point'] ) ) ? $_POST['cpm_point'] : array();
132
+ $new_cpm_map = $this->array_map_recursive(array($this, 'sanitize_html'), $new_cpm_point);
133
  $new_cpm_map = ( isset( $_POST['cpm_map'] ) ) ? $_POST['cpm_map'] : array();
134
+ $new_cpm_map = $this->array_map_recursive('sanitize_text_field', $new_cpm_map);
135
 
136
  $new_cpm_point['icon'] = str_replace( CPM_PLUGIN_URL, '', $default_icon );
137
 
910
  // Check if post exists and save the configuraton options
911
  if (isset($_POST['cpm_map_noncename']) && wp_verify_nonce($_POST['cpm_map_noncename'],__FILE__)){
912
  $options = $_POST['cpm_map'];
913
+ $options = $this->array_map_recursive('sanitize_text_field', $options);
914
  $options['drag_map'] = ( isset( $options[ 'drag_map' ] ) ) ? true : false;
915
  $options['windowhtml'] = $this->get_configuration_option('windowhtml');
916
  update_option('cpm_config', $options);
readme.txt CHANGED
@@ -517,6 +517,10 @@ Now the most important part create the shape's area. To create the shape's area
517
 
518
  == Changelog ==
519
 
 
 
 
 
520
  = 1.0.23 =
521
 
522
  * Improves the plugin performance and the maps generation.
517
 
518
  == Changelog ==
519
 
520
+ = 1.0.24 =
521
+
522
+ * Fixes an issue processing the maps settings.
523
+
524
  = 1.0.23 =
525
 
526
  * Improves the plugin performance and the maps generation.