Aude has submitted this change and it was merged. Change subject: Protect against width being undefined ......................................................................
Protect against width being undefined Change-Id: I841a29fb93e10c8ffbaead4bcef993b6df01edbe --- M MapSources.hooks.php 1 file changed, 15 insertions(+), 11 deletions(-) Approvals: Aude: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/MapSources.hooks.php b/MapSources.hooks.php index 411c3cc..77cb81a 100644 --- a/MapSources.hooks.php +++ b/MapSources.hooks.php @@ -29,17 +29,21 @@ ( $args['lon'] + $span * cos( $args['lat'] * 0.0175 ) ).','. ( $args['lat'] + $span / 2 ); - return - Html::element( 'iframe', array( - // based on https://de.wikipedia.org/w/index.php?title=MediaWiki:GeoHack.js - 'src' => '//toolserver.org/~kolossos/openlayers/embed.html?' . http_build_query( array( - 'layer' => strtolower( $args['layer'] ), - 'bbox' => $bbox, - 'marker' => $args['lat'].','.$args['lon'] - ) ), - 'width' => $args['w'], - 'height' => $args['h'], - ) ); + $options = array( + // based on https://de.wikipedia.org/w/index.php?title=MediaWiki:GeoHack.js + 'src' => '//toolserver.org/~kolossos/openlayers/embed.html?' . http_build_query( array( + 'layer' => strtolower( $args['layer'] ), + 'bbox' => $bbox, + 'marker' => $args['lat'].','.$args['lon'] + ) ), + 'height' => $args['h'], + ); + + if ( isset( $args['w'] ) ) { + $options['width'] = $args['w']; + } + + return Html::element( 'iframe', $options ); } /** -- To view, visit https://gerrit.wikimedia.org/r/194154 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I841a29fb93e10c8ffbaead4bcef993b6df01edbe Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MapSources Gerrit-Branch: master Gerrit-Owner: Chad <ch...@wikimedia.org> Gerrit-Reviewer: Aude <aude.w...@gmail.com> Gerrit-Reviewer: Chad <ch...@wikimedia.org> Gerrit-Reviewer: Nemo bis <federicol...@tiscali.it> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits