Google Maps Easy - Version 1.9.31

Version Description

Download this release

Release Info

Developer supsystic.com
Plugin Icon 128x128 Google Maps Easy
Version 1.9.31
Comparing to
See all releases

Code changes from version 1.9.30 to 1.9.31

Files changed (5) hide show
  1. classes/frame.php +2 -0
  2. classes/req.php +97 -29
  3. config.php +1 -1
  4. gmp.php +1 -1
  5. readme.txt +7 -2
classes/frame.php CHANGED
@@ -363,6 +363,7 @@ class frameGmp {
363
  $vars = array_merge($vars, $this->_scriptsVars[$s['handle']]);
364
  if($vars) {
365
  foreach($vars as $k => $v) {
 
366
  wp_localize_script($s['handle'], $k, $v);
367
  }
368
  }
@@ -373,6 +374,7 @@ class frameGmp {
373
  }
374
  public function addJSVar($script, $name, $val) {
375
  if($this->_scriptsInitialized) {
 
376
  wp_localize_script($script, $name, $val);
377
  } else {
378
  $this->_scriptsVars[$script][$name] = $val;
363
  $vars = array_merge($vars, $this->_scriptsVars[$s['handle']]);
364
  if($vars) {
365
  foreach($vars as $k => $v) {
366
+ $v = is_array($v) ? $v : array($v);
367
  wp_localize_script($s['handle'], $k, $v);
368
  }
369
  }
374
  }
375
  public function addJSVar($script, $name, $val) {
376
  if($this->_scriptsInitialized) {
377
+ $val = is_array($val) ? $val : array($val);
378
  wp_localize_script($script, $name, $val);
379
  } else {
380
  $this->_scriptsVars[$script][$name] = $val;
classes/req.php CHANGED
@@ -17,6 +17,31 @@ class reqGmp {
17
  * @param mixed $default default value - will be returned if $name wasn't found
18
  * @return mixed value of a variable, if didn't found - $default (NULL by default)
19
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  static public function getVar($name, $from = 'all', $default = NULL) {
21
  $from = strtolower($from);
22
  if($from == 'all') {
@@ -26,37 +51,59 @@ class reqGmp {
26
  $from = 'post';
27
  }
28
  }
29
-
30
  switch($from) {
31
- case 'get':
32
- if(isset($_GET[$name]))
33
- return $_GET[$name];
34
- break;
35
- case 'post':
36
- if(isset($_POST[$name]))
37
- return $_POST[$name];
38
- break;
39
- case 'file':
40
- case 'files':
41
- if(isset($_FILES[$name]))
42
- return $_FILES[$name];
43
- break;
44
- case 'session':
45
- if(isset($_SESSION[$name]))
46
- return $_SESSION[$name];
47
- break;
48
- case 'server':
49
- if(isset($_SERVER[$name]))
50
- return $_SERVER[$name];
51
- break;
52
- case 'cookie':
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  if(isset($_COOKIE[$name])) {
54
  $value = $_COOKIE[$name];
55
  if(strpos($value, '_JSON:') === 0) {
56
  $value = explode('_JSON:', $value);
57
  $value = utilsGmp::jsonDecode(array_pop($value));
58
  }
59
- return $value;
60
  }
61
  break;
62
  }
@@ -68,6 +115,11 @@ class reqGmp {
68
  }
69
  static public function setVar($name, $val, $in = 'input') {
70
  $in = strtolower($in);
 
 
 
 
 
71
  switch($in) {
72
  case 'get':
73
  $_GET[$name] = $val;
@@ -101,17 +153,33 @@ class reqGmp {
101
  $what = strtolower($what);
102
  switch($what) {
103
  case 'get':
104
- return $_GET;
 
 
 
 
105
  break;
106
  case 'post':
107
- return $_POST;
 
 
 
 
108
  break;
109
  case 'session':
110
- return $_SESSION;
 
 
 
 
111
  break;
112
  case 'files':
113
- return $_FILES;
114
- break;
 
 
 
 
115
  }
116
  return NULL;
117
  }
17
  * @param mixed $default default value - will be returned if $name wasn't found
18
  * @return mixed value of a variable, if didn't found - $default (NULL by default)
19
  */
20
+
21
+ static public function sanitize_array( &$array, $parentKey = '' ) {
22
+ $allowed = '<div><span><pre><p><br><hr><hgroup><h1><h2><h3><h4><h5><h6>
23
+ <ul><ol><li><dl><dt><dd><strong><em><b><i><u>
24
+ <img><a><abbr><address><blockquote><area><audio><video>
25
+ <form><fieldset><label><input><textarea>
26
+ <caption><table><tbody><td><tfoot><th><thead><tr>
27
+ <iframe><select><option>';
28
+ $keys = array('description');
29
+ foreach ($array as $key => &$value) {
30
+ if (in_array($key, $keys)) {
31
+ if (!is_array($value)) {
32
+ $value = strip_tags($value, $allowed);
33
+ }
34
+ } else {
35
+ if( !is_array($value) ) {
36
+ $value = sanitize_text_field($value);
37
+ } else {
38
+ self::sanitize_array($value);
39
+ }
40
+ }
41
+ }
42
+ return $array;
43
+ }
44
+
45
  static public function getVar($name, $from = 'all', $default = NULL) {
46
  $from = strtolower($from);
47
  if($from == 'all') {
51
  $from = 'post';
52
  }
53
  }
54
+
55
  switch($from) {
56
+ case 'get':
57
+ if(isset($_GET[$name])) {
58
+ if (is_array($_GET[$name])) {
59
+ return self::sanitize_array($_GET[$name]);
60
+ } else {
61
+ return sanitize_text_field($_GET[$name]);
62
+ }
63
+ }
64
+ break;
65
+ case 'post':
66
+ if(isset($_POST[$name])) {
67
+ if (is_array($_POST[$name])) {
68
+ return self::sanitize_array($_POST[$name]);
69
+ } else {
70
+ return sanitize_text_field($_POST[$name]);
71
+ }
72
+ }
73
+ break;
74
+ case 'file':
75
+ case 'files':
76
+ $name = sanitize_file_name($name);
77
+ if(isset($_FILES[$name])) {
78
+ return $_FILES[$name];
79
+ }
80
+ break;
81
+ case 'session':
82
+ if(isset($_SESSION[$name])) {
83
+ if (is_array($_SESSION[$name])) {
84
+ return self::sanitize_array($_SESSION[$name]);
85
+ } else {
86
+ return sanitize_text_field($_SESSION[$name]);
87
+ }
88
+ }
89
+ break;
90
+ case 'server':
91
+ if(isset($_SERVER[$name])) {
92
+ if (is_array($_SERVER[$name])) {
93
+ return self::sanitize_array($_SERVER[$name]);
94
+ } else {
95
+ return sanitize_text_field($_SERVER[$name]);
96
+ }
97
+ }
98
+ break;
99
+ case 'cookie':
100
  if(isset($_COOKIE[$name])) {
101
  $value = $_COOKIE[$name];
102
  if(strpos($value, '_JSON:') === 0) {
103
  $value = explode('_JSON:', $value);
104
  $value = utilsGmp::jsonDecode(array_pop($value));
105
  }
106
+ return sanitize_text_field($value);
107
  }
108
  break;
109
  }
115
  }
116
  static public function setVar($name, $val, $in = 'input') {
117
  $in = strtolower($in);
118
+ if (is_array($val)) {
119
+ $val = $this->sanitize_array($val);
120
+ } else {
121
+ $val = sanitize_text_field($val);
122
+ }
123
  switch($in) {
124
  case 'get':
125
  $_GET[$name] = $val;
153
  $what = strtolower($what);
154
  switch($what) {
155
  case 'get':
156
+ if (is_array($_GET)) {
157
+ return self::sanitize_array($_GET);
158
+ } else {
159
+ return sanitize_text_field($_GET);
160
+ }
161
  break;
162
  case 'post':
163
+ if (is_array($_POST)) {
164
+ return self::sanitize_array($_POST);
165
+ } else {
166
+ return sanitize_text_field($_POST);
167
+ }
168
  break;
169
  case 'session':
170
+ if (is_array($_SESSION)) {
171
+ return self::sanitize_array($_SESSION);
172
+ } else {
173
+ return sanitize_text_field($_SESSION);
174
+ }
175
  break;
176
  case 'files':
177
+ if (!empty($_FILES['kml_file'])) {
178
+ $files = $_FILES['kml_file'];
179
+ $files['kml_file']['name'] = sanitize_file_name($files['kml_file']['name']);
180
+ return $files;
181
+ }
182
+ break;
183
  }
184
  return NULL;
185
  }
config.php CHANGED
@@ -48,7 +48,7 @@
48
  define('GMP_EOL', "\n");
49
 
50
  define('GMP_PLUGIN_INSTALLED', true);
51
- define('GMP_VERSION_PLUGIN', '1.9.30'); //GMP_VERSION is pre-defined constant for PHP GMP module http://php.net/manual/en/book.gmp.php
52
  define('GMP_USER', 'user');
53
 
54
  define('GMP_CLASS_PREFIX', 'gmpc');
48
  define('GMP_EOL', "\n");
49
 
50
  define('GMP_PLUGIN_INSTALLED', true);
51
+ define('GMP_VERSION_PLUGIN', '1.9.31'); //GMP_VERSION is pre-defined constant for PHP GMP module http://php.net/manual/en/book.gmp.php
52
  define('GMP_USER', 'user');
53
 
54
  define('GMP_CLASS_PREFIX', 'gmpc');
gmp.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Google Maps Easy
4
  * Plugin URI: http://supsystic.com/plugins/google-maps-plugin/
5
  * Description: The easiest way to create Google Map with markers or locations. Display any data on the map: text, images, videos. Custom map marker icons
6
- * Version: 1.9.30
7
  * Author: supsystic.com
8
  * Author URI: http://supsystic.com
9
  * Text Domain: google-maps-easy
3
  * Plugin Name: Google Maps Easy
4
  * Plugin URI: http://supsystic.com/plugins/google-maps-plugin/
5
  * Description: The easiest way to create Google Map with markers or locations. Display any data on the map: text, images, videos. Custom map marker icons
6
+ * Version: 1.9.31
7
  * Author: supsystic.com
8
  * Author URI: http://supsystic.com
9
  * Text Domain: google-maps-easy
readme.txt CHANGED
@@ -4,8 +4,8 @@ Author URI: https://supsystic.com/
4
  Plugin URI: https://supsystic.com/plugins/google-maps-plugin
5
  Donate link: https://supsystic.com/plugins/google-maps-plugin
6
  Tags: google map, map, Google Maps, map markers, location
7
- Tested up to: 5.5
8
- Stable tag: 1.9.30
9
 
10
  Google Maps with markers, locations and clusterization, KML layers and filters. Custom Google map markers with text, images, videos, links.
11
 
@@ -293,6 +293,11 @@ Google Maps Easy plugin admin area. Add a marker to the google map.
293
 
294
 
295
  == Changelog ==
 
 
 
 
 
296
  = Google Map Plugin v1.9.30 / 29.09.2020 =
297
  * Add fix for WP 5.5
298
  * Fix for zoom issue
4
  Plugin URI: https://supsystic.com/plugins/google-maps-plugin
5
  Donate link: https://supsystic.com/plugins/google-maps-plugin
6
  Tags: google map, map, Google Maps, map markers, location
7
+ Tested up to: 5.7
8
+ Stable tag: 1.9.31
9
 
10
  Google Maps with markers, locations and clusterization, KML layers and filters. Custom Google map markers with text, images, videos, links.
11
 
293
 
294
 
295
  == Changelog ==
296
+ = Google Map Plugin v1.9.31 / 26.03.2021 =
297
+ * Add fix for WP 5.7
298
+ * Add security fixes
299
+ * Add fix for OVH gateway
300
+
301
  = Google Map Plugin v1.9.30 / 29.09.2020 =
302
  * Add fix for WP 5.5
303
  * Fix for zoom issue