jenkins-bot has submitted this change and it was merged.
Change subject: Lowercase coordinate types to be slightly foolproof
......................................................................
Lowercase coordinate types to be slightly foolproof
Change-Id: Ia84f482466e8b3f9e698ae154f2915b63545b9c7
---
M CoordinatesParserFunction.php
M tests/TagTest.php
2 files changed, 6 insertions(+), 1 deletion(-)
Approvals:
Aude: Looks good to me, approved
jenkins-bot: Verified
diff --git a/CoordinatesParserFunction.php b/CoordinatesParserFunction.php
index 335a81f..5f989f4 100644
--- a/CoordinatesParserFunction.php
+++ b/CoordinatesParserFunction.php
@@ -160,7 +160,7 @@
}
$coord->dim = $wgDefaultDim;
if ( isset( $args['type'] ) ) {
- $coord->type = preg_replace( '/\(.*?\).*$/', '',
$args['type'] );
+ $coord->type = mb_strtolower( preg_replace(
'/\(.*?\).*$/', '', $args['type'] ) );
if ( isset( $wgTypeToDim[$coord->type] ) ) {
$coord->dim = $wgTypeToDim[$coord->type];
} else {
diff --git a/tests/TagTest.php b/tests/TagTest.php
index 44ee626..7dd1453 100644
--- a/tests/TagTest.php
+++ b/tests/TagTest.php
@@ -160,6 +160,11 @@
'{{#coordinates: -3.29237|-60.624889|globe=}}',
array( 'lat' => -3.29237, 'lon' => -60.624889,
'globe' => 'earth' ),
),
+ // Lowercase type
+ array(
+ '{{#coordinates: 10|20|type:sOmEtHiNg}}',
+ array( 'lat' => 10, 'lon' => 20, 'globe' =>
'earth', 'type' => 'something' ),
+ ),
);
}
--
To view, visit https://gerrit.wikimedia.org/r/237521
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia84f482466e8b3f9e698ae154f2915b63545b9c7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GeoData
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits