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 | class GoogleMapBasic_Controller extends Extension |
||
0 ignored issues
–
show
|
|||
4 | { |
||
5 | private static $js_location = ''; |
||
0 ignored issues
–
show
|
|||
6 | |||
7 | private static $id_of_map_div = 'GoogleMapBasic'; |
||
0 ignored issues
–
show
|
|||
8 | |||
9 | private static $api_key = ''; |
||
0 ignored issues
–
show
|
|||
10 | |||
11 | public function HasGoogleMap() |
||
12 | { |
||
13 | return $this->owner->ShowMap && $this->owner->Address; |
||
0 ignored issues
–
show
The property
ShowMap does not seem to exist in SS_Object .
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name. If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading. ![]() The property
Address does not seem to exist in SS_Object .
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name. If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading. ![]() |
|||
14 | } |
||
15 | |||
16 | public function GoogleMapBasic() |
||
17 | { |
||
18 | if ($this->owner->HasGoogleMap()) { |
||
19 | if ($this->owner->StaticMap) { |
||
0 ignored issues
–
show
The property
StaticMap does not seem to exist in SS_Object .
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name. If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading. ![]() |
|||
20 | return true; |
||
21 | } else { |
||
22 | $fileLocation = Config::inst()->get("GoogleMapBasic_Controller", "js_location"); |
||
23 | $idOfMapDiv = Config::inst()->get("GoogleMapBasic_Controller", "id_of_map_div"); |
||
24 | $apiKey = Config::inst()->get("GoogleMapBasic_Controller", "api_key"); |
||
25 | if (! $fileLocation) { |
||
26 | $fileLocation = 'googlemapbasic/javascript/GoogleMapBasic.js'; |
||
27 | } |
||
28 | Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js'); |
||
29 | Requirements::javascript(Director::protocol() . 'maps.googleapis.com/maps/api/js?key='.$apiKey .''); |
||
30 | Requirements::javascript($fileLocation); |
||
31 | $infoWindow = '<div class="infoWindowContent typography">'.$this->owner->InfoWindowContent.$this->GoogleMapBasicExternalLinkHTML().'</div>'; |
||
0 ignored issues
–
show
The property
InfoWindowContent does not seem to exist in SS_Object .
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name. If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading. ![]() |
|||
32 | Requirements::customScript( |
||
33 | " |
||
34 | if(typeof GoogleMapBasicOptions === 'undefined') { |
||
35 | var GoogleMapBasicOptions = new Array(); |
||
36 | } |
||
37 | GoogleMapBasicOptions.push( |
||
38 | { |
||
39 | idOfMapDiv: \"".$this->cleanJS($idOfMapDiv)."\", |
||
40 | infoWindowContent: \"".$this->cleanJS($infoWindow)."\", |
||
41 | title: \"".$this->cleanJS($this->owner->Title)."\", |
||
0 ignored issues
–
show
The property
Title does not seem to exist in SS_Object .
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name. If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading. ![]() |
|||
42 | address: \"".$this->cleanJS($this->owner->Address)."\", |
||
0 ignored issues
–
show
The property
Address does not seem to exist in SS_Object .
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name. If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading. ![]() |
|||
43 | lat: ".floatval($this->owner->Lat).", |
||
0 ignored issues
–
show
The property
Lat does not seem to exist in SS_Object .
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name. If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading. ![]() |
|||
44 | lng: ".floatval($this->owner->Lng).", |
||
0 ignored issues
–
show
The property
Lng does not seem to exist in SS_Object .
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name. If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading. ![]() |
|||
45 | zoomLevel: ".intval($this->owner->ZoomLevel)." |
||
0 ignored issues
–
show
The property
ZoomLevel does not seem to exist in SS_Object .
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name. If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading. ![]() |
|||
46 | } |
||
47 | ); |
||
48 | ", |
||
49 | 'GoogleMapBasicData' |
||
50 | ); |
||
51 | Requirements::themedCSS('GoogleMapBasic', "googlemapbasic"); |
||
52 | return _t("GoolgeMapBasic.MAPLOADING", "map loading..."); |
||
53 | } |
||
54 | } |
||
55 | return false; |
||
56 | } |
||
57 | |||
58 | public function GoogleMapBasicStaticMapSource($width = 512, $height = 512) |
||
59 | { |
||
60 | $center = $this->googleMapBasicCenterForLink(); |
||
61 | $src = Director::protocol() . 'maps.googleapis.com/maps/api/staticmap?'; |
||
62 | $src .= 'center='.$center; |
||
63 | $src .= '&zoom='.$this->owner->ZoomLevel; |
||
0 ignored issues
–
show
The property
ZoomLevel does not seem to exist in SS_Object .
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name. If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading. ![]() |
|||
64 | $src .= '&size='.$width.'x'.$height.''; |
||
65 | $src .= '&maptype=roadmap'; |
||
66 | $src .= '&markers=color:red%7C'.$center; |
||
67 | |||
68 | return $src; |
||
69 | } |
||
70 | |||
71 | |||
72 | public function GoogleMapBasicExternalLink() |
||
73 | { |
||
74 | if ($this->owner->HasGoogleMap()) { |
||
75 | $center = $this->googleMapBasicCenterForLink(); |
||
76 | return Director::protocol() . 'maps.google.com/maps?q='.$center.'&z='.$this->owner->ZoomLevel; |
||
0 ignored issues
–
show
The property
ZoomLevel does not seem to exist in SS_Object .
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name. If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading. ![]() |
|||
77 | } |
||
78 | } |
||
79 | |||
80 | public function GoogleMapBasicExternalLinkHTML() |
||
81 | { |
||
82 | if ($this->owner->HasGoogleMap()) { |
||
83 | return '<p id="GoogleMapBasicExternalLink"><a href="'.$this->GoogleMapBasicExternalLink().'" target="_map">'._t("GoogleMapBasic.OPENINGOOGLEMAPS", "open in Google Maps").'</a></p>'; |
||
84 | } |
||
85 | } |
||
86 | |||
87 | protected function googleMapBasicCenterForLink() |
||
88 | { |
||
89 | if ($this->owner->Lat && $this->owner->Lng) { |
||
90 | $center = $this->owner->Lat.','.$this->owner->Lng; |
||
0 ignored issues
–
show
The property
Lat does not seem to exist in SS_Object .
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name. If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading. ![]() The property
Lng does not seem to exist in SS_Object .
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name. If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading. ![]() |
|||
91 | } elseif ($this->owner->Address) { |
||
0 ignored issues
–
show
The property
Address does not seem to exist in SS_Object .
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name. If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading. ![]() |
|||
92 | $center = urlencode($this->owner->Address); |
||
93 | } else { |
||
94 | $center = ''; |
||
95 | } |
||
96 | |||
97 | return $center; |
||
98 | } |
||
99 | |||
100 | protected function cleanJS($s) |
||
101 | { |
||
102 | $s = Convert::raw2js($s); |
||
103 | $s = str_replace("\r\n", " ", $s); |
||
104 | $s = str_replace("\n", " ", $s); |
||
105 | $s = str_replace('/', '\/', $s); |
||
106 | return $s; |
||
107 | } |
||
108 | } |
||
109 |
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.