PluginProbe
Maps Plugin using Google Maps for WordPress – WP Google Map / trunk
Maps Plugin using Google Maps for WordPress – WP Google Map vtrunk
1.9.7 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0 1.5.1 1.5.2 1.5.3 All 96 releases
gmap-embed / includes / traits / Filters.php

Filters.php in Maps Plugin using Google Maps for WordPress – WP Google Map trunk, at includes/traits/Filters.php

36 lines 827 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace WGMSRM\Traits;
3
4 if (!defined('ABSPATH')) {
5 exit;
6 }
7
8 /**
9 * Filters related to the plugin will be listed here
10 */
11 trait Filters
12 {
13
14 /**
15 * In case of Google Map API loaded by other plugins or themes, it will prevent and load a blank script (Only removes by user consent)
16 *
17 * @param string $tag
18 * @param string $handle
19 * @param string $src
20 * @return mixed|string
21 * @since 1.7.5
22 */
23 public function do_prevent_others_google_maps_tag($tag, $handle, $src)
24 {
25 // Validate and sanitize $src before using in regex
26 $src = is_string($src) ? $src : '';
27 if (preg_match('/maps\.google/i', $src)) {
28 if (is_string($handle) && $handle !== 'wp-gmap-api') {
29 return '';
30 }
31 }
32 // Escape output for XSS protection if outputting $tag elsewhere
33 return $tag;
34 }
35 }
36