Index: trunk/extensions/SemanticMaps/FormInputs/SM_FormInput.php |
— | — | @@ -151,8 +151,8 @@ |
152 | 152 | $centre = MapsGeocodeUtils::attemptToGeocode($this->centre, $this->geoservice, $this->serviceName); |
153 | 153 | $centre = MapsUtils::getLatLon($centre); |
154 | 154 | |
155 | | - $this->centre_lat = $centre['lat']; |
156 | | - $this->centre_lon = $centre['lon']; |
| 155 | + $this->centre_lat = Xml::escapeJsString( $centre['lat'] ); |
| 156 | + $this->centre_lon = Xml::escapeJsString( $centre['lon'] ); |
157 | 157 | } |
158 | 158 | } |
159 | 159 | |
Index: trunk/extensions/SemanticMaps/SemanticMaps.php |
— | — | @@ -35,10 +35,9 @@ |
36 | 36 | |
37 | 37 | // Only initialize the extension when all dependencies are present. |
38 | 38 | if (defined( 'Maps_VERSION' ) && defined( 'SMW_VERSION' )) { |
39 | | - define('SM_VERSION', '0.5.4 a2'); |
| 39 | + define('SM_VERSION', '0.5.4 a4'); |
40 | 40 | |
41 | | - // TODO: try to get out the hardcoded path. |
42 | | - $smgScriptPath = $wgScriptPath . '/extensions/SemanticMaps'; |
| 41 | + $smgScriptPath = (isset($wgExtensionAssetsPath) && $wgExtensionAssetsPath ? $wgExtensionAssetsPath : $wgScriptPath . '/extensions') . '/SemanticMaps'; |
43 | 42 | $smgDir = dirname( __FILE__ ) . '/'; |
44 | 43 | |
45 | 44 | $smgStyleVersion = $wgStyleVersion . '-' . SM_VERSION; |
Index: trunk/extensions/SemanticMaps/QueryPrinters/SM_MapPrinter.php |
— | — | @@ -207,14 +207,14 @@ |
208 | 208 | } |
209 | 209 | } |
210 | 210 | } |
211 | | - |
| 211 | + |
212 | 212 | foreach ($coords as $coord) { |
213 | 213 | if (count($coord) == 2) { |
214 | 214 | list($lat, $lon) = $coord; |
215 | | - |
| 215 | + |
216 | 216 | if (strlen($lat) > 0 && strlen($lon) > 0) { |
217 | 217 | $icon = $this->getLocationIcon($row); |
218 | | - |
| 218 | + |
219 | 219 | if ($this->template) { |
220 | 220 | global $wgParser; |
221 | 221 | $segments = array_merge( |
— | — | @@ -223,13 +223,19 @@ |
224 | 224 | ); |
225 | 225 | $text = preg_replace('/\n+/m', '<br />', $wgParser->recursiveTagParse('{{' . implode('|', $segments) . '}}')); |
226 | 226 | } |
227 | | - |
228 | | - $this->m_locations[] = array($lat, $lon, $title, $text, $icon); |
| 227 | + |
| 228 | + $this->m_locations[] = array( |
| 229 | + Xml::escapeJsString($lat), |
| 230 | + Xml::escapeJsString($lon), |
| 231 | + Xml::escapeJsString($title), |
| 232 | + Xml::escapeJsString($text), |
| 233 | + Xml::escapeJsString($icon) |
| 234 | + ); |
229 | 235 | } |
230 | 236 | } |
231 | 237 | } |
232 | 238 | } |
233 | | - |
| 239 | + |
234 | 240 | /** |
235 | 241 | * Get the icon for a row |
236 | 242 | * |
— | — | @@ -305,8 +311,8 @@ |
306 | 312 | } |
307 | 313 | elseif (count($this->m_locations) == 1) { |
308 | 314 | // If centre is not set and there is exactelly one marker, use it's coordinates. |
309 | | - $this->centre_lat = $this->m_locations[0][0]; |
310 | | - $this->centre_lon = $this->m_locations[0][1]; |
| 315 | + $this->centre_lat = Xml::escapeJsString( $this->m_locations[0][0] ); |
| 316 | + $this->centre_lon = Xml::escapeJsString( $this->m_locations[0][1] ); |
311 | 317 | } |
312 | 318 | else { |
313 | 319 | // If centre is not set and there are no results, centre on the default coordinates. |
Index: trunk/extensions/SemanticMaps/GoogleMaps/SM_GoogleMapsQP.php |
— | — | @@ -83,7 +83,7 @@ |
84 | 84 | $markersString = implode(',', $markerItems); |
85 | 85 | |
86 | 86 | $this->output .= <<<END |
87 | | -<div id="$this->mapName" class="$this->class" style="$this->style" ></div> |
| 87 | +<div id="$this->mapName"></div> |
88 | 88 | <script type="$wgJsMimeType"> /*<![CDATA[*/ |
89 | 89 | addOnloadHook( |
90 | 90 | initializeGoogleMap('$this->mapName', |
Index: trunk/extensions/SemanticMaps/GoogleMaps/SM_GoogleMapsFormInput.php |
— | — | @@ -79,7 +79,7 @@ |
80 | 80 | } |
81 | 81 | |
82 | 82 | $this->output .= " |
83 | | - <div id='".$this->mapName."' class='".$this->class."'></div> |
| 83 | + <div id='".$this->mapName."'></div> |
84 | 84 | |
85 | 85 | <script type='$wgJsMimeType'>/*<![CDATA[*/ |
86 | 86 | addOnloadHook( |