This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | |||
4 | class DynamicGoogleMapSmarter extends Object |
||
0 ignored issues
–
show
|
|||
5 | { |
||
6 | |||
7 | /** |
||
8 | * points are formatted like this: |
||
9 | * - points:[ |
||
10 | * - id: ... |
||
11 | * - title: .... |
||
12 | * - address: ... |
||
13 | * - lat: ... |
||
14 | * - lng: .... |
||
15 | * ] |
||
16 | * address OR lat / lng are optional (set lat / lng to zero to ) |
||
17 | * |
||
18 | * @param array $points |
||
19 | * @param string $markerCallback (optional) |
||
20 | * @return this |
||
21 | */ |
||
22 | public function createMap($points, $markerCallback = null) |
||
23 | { |
||
24 | $googleJS = |
||
25 | "//maps.googleapis.com/maps/api/js" |
||
26 | ."?v=".Config::inst()->get('GoogleMapSmarter', "api_version") |
||
27 | ."&libraries=places" |
||
28 | ."&key=".Config::inst()->get('GoogleMapSmarter', "api_key"); |
||
29 | Requirements::javascript($googleJS); |
||
30 | Requirements::javascript('google_map_smarter/javascript/GoogleMapSmarter.js'); |
||
31 | $fx = $this->getMapVariable('markerCallbackFX', 'marker_callback_fx'); |
||
32 | $dLat = $this->getMapVariable('defaultLocationLat', 'default_location_lat'); |
||
33 | $dLng = $this->getMapVariable('defaultLocationLng', 'default_location_lng'); |
||
34 | Requirements::customScript(' |
||
35 | if(typeof GoogleMapSmarterOptions === "undefined") { |
||
36 | var GoogleMapSmarterOptions = []; |
||
37 | } |
||
38 | GoogleMapSmarterOptions.push({ |
||
39 | id: "'.$this->getMapVariable('mapID', 'map_id').'", |
||
40 | iconIsRetinaSize: '.($this->getMapVariable('iconIsRetinaSize', 'icon_is_retina_size') ? 1 : 0).', |
||
41 | iconURL: "'.$this->getMapVariable('iconURL', 'icon_url').'", |
||
42 | iconWidth: '.$this->getMapVariable('iconWidth', 'icon_width').', |
||
43 | iconHeight: '.$this->getMapVariable('iconHeight', 'icon_height').', |
||
44 | defaultZoom: '.$this->getMapVariable('defaultZoom', 'default_zoom').', |
||
45 | defaultLocation: { |
||
46 | lat: '.($dLat ? $dLat : 0).', |
||
47 | lng: '.($dLng ? $dLng : 0).' |
||
48 | }, |
||
49 | points: '.json_encode($points).', |
||
50 | markerCallbackFX: '.($fx ? $fx : 'null').' |
||
51 | }); |
||
52 | ', |
||
53 | 'CustomScript'.$this->getMapVariable('mapID', 'map_id') |
||
54 | ); |
||
55 | |||
56 | return $this; |
||
57 | } |
||
58 | |||
59 | private static $map_id = 'google-map'; |
||
60 | |||
61 | private static $icon_is_retina_size = true; |
||
62 | |||
63 | private static $icon_url = 'http://icons.iconarchive.com/icons/paomedia/small-n-flat/1024/map-marker-icon.png'; |
||
64 | |||
65 | private static $icon_width = 90; |
||
66 | |||
67 | private static $icon_height = 90; |
||
68 | |||
69 | private static $default_zoom = 7; |
||
70 | |||
71 | private static $default_location_lat = -45; |
||
72 | |||
73 | private static $default_location_lng = 174; |
||
74 | |||
75 | private static $marker_callback_fx = null; |
||
76 | |||
77 | protected $mapID = null; |
||
78 | |||
79 | protected $iconIsRetinaSize = null; |
||
80 | |||
81 | protected $iconURL = null; |
||
82 | |||
83 | protected $iconWidth = null; |
||
84 | |||
85 | protected $iconHeight = null; |
||
86 | |||
87 | protected $defaultZoom = null; |
||
88 | |||
89 | protected $defaultLocationLat = null; |
||
90 | |||
91 | protected $defaultLocationLng = null; |
||
92 | |||
93 | protected $markerCallbackFx = null; |
||
94 | |||
95 | public function setMapID($s) |
||
96 | { |
||
97 | return $this->setMapVariable('mapID', $s); |
||
98 | } |
||
99 | |||
100 | public function getMapID($s) |
||
101 | { |
||
102 | return $this->getMapVariable('mapID', 'map_id'); |
||
103 | } |
||
104 | |||
105 | public function setIconIsRetinaSize($s) |
||
106 | { |
||
107 | return $this->setMapVariable('iconIsRetinaSize', $s); |
||
108 | } |
||
109 | |||
110 | public function getIconIsRetinaSize($s) |
||
111 | { |
||
112 | return $this->getMapVariable('iconIsRetinaSize', 'icon_is_retina_size'); |
||
113 | } |
||
114 | |||
115 | |||
116 | public function setIconURL($s) |
||
117 | { |
||
118 | return $this->setMapVariable('iconURL', $s); |
||
119 | } |
||
120 | |||
121 | public function getIconURL($s) |
||
122 | { |
||
123 | return $this->getMapVariable('iconURL', 'icon_url'); |
||
124 | } |
||
125 | |||
126 | public function setIconWidth($s) |
||
127 | { |
||
128 | return $this->setMapVariable('iconWidth', $s); |
||
129 | } |
||
130 | |||
131 | public function getIconWidth($s) |
||
132 | { |
||
133 | return $this->getMapVariable('iconWidth', 'icon_width'); |
||
134 | } |
||
135 | |||
136 | public function setIconHeight($s) |
||
137 | { |
||
138 | return $this->setMapVariable('iconHeight', $s); |
||
139 | } |
||
140 | |||
141 | public function getIconHeight($s) |
||
142 | { |
||
143 | return $this->getMapVariable('iconHeight', 'icon_height'); |
||
144 | } |
||
145 | |||
146 | public function setDefaultZOom($s) |
||
147 | { |
||
148 | return $this->setMapVariable('defaultZoom', $s); |
||
149 | } |
||
150 | |||
151 | public function getDefaultZoom($s) |
||
152 | { |
||
153 | return $this->getMapVariable('defaultZoom', 'defaultZoom'); |
||
154 | } |
||
155 | |||
156 | public function setDefaultLocationLat($s) |
||
157 | { |
||
158 | return $this->setMapVariable('defaultLocationLat', $s); |
||
159 | } |
||
160 | |||
161 | public function getDefaultLocationLat($s) |
||
162 | { |
||
163 | return $this->getMapVariable('defaultLocationLat', 'defaultLocation_lat'); |
||
164 | } |
||
165 | |||
166 | public function setDefaultLocationLng($s) |
||
167 | { |
||
168 | return $this->setMapVariable('defaultLocationLng', $s); |
||
169 | } |
||
170 | |||
171 | public function getDefaultLocationLng($s) |
||
172 | { |
||
173 | return $this->getMapVariable('defaultLocationLng', 'defaultLocation_lng'); |
||
174 | } |
||
175 | |||
176 | public function setMarkerCallbackFX($s) |
||
177 | { |
||
178 | return $this->setMapVariable('markerCallbackFX', $s); |
||
179 | } |
||
180 | |||
181 | public function getMarkerCallbackFX($s) |
||
182 | { |
||
183 | return $this->getMapVariable('markerCallbackFX', 'marker_callback_fx'); |
||
184 | } |
||
185 | |||
186 | /** |
||
187 | * |
||
188 | * |
||
189 | * @param string $internalVariableName the variable name |
||
190 | * @param string $staticVariableName the static variable name |
||
191 | * |
||
192 | * @param return this |
||
193 | */ |
||
194 | protected function getMapVariable($internalVariableName, $staticVariableName) |
||
195 | { |
||
196 | if ($this->$internalVariableName !== null) { |
||
197 | return $this->$internalVariableName; |
||
198 | } else { |
||
199 | return $this->Config()->$staticVariableName; |
||
200 | } |
||
201 | } |
||
202 | |||
203 | /** |
||
204 | * |
||
205 | * |
||
206 | * @param string $internalVariableName the variable name |
||
207 | * @param mixed $s the variable to set |
||
208 | * |
||
209 | * @param return this |
||
210 | */ |
||
211 | protected function setMapVariable($internalVariableName, $s) |
||
212 | { |
||
213 | $this->$internalVariableName = $s; |
||
214 | return $this; |
||
215 | } |
||
216 | } |
||
217 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.