Jqnatividad has uploaded a new change for review. https://gerrit.wikimedia.org/r/76926
Change subject: added urldecode support when parsing name to GeoSearch API. This allows using spaces (%20), underscores (%5F) and other special characters when specifying the name extra parameter. ...................................................................... added urldecode support when parsing name to GeoSearch API. This allows using spaces (%20), underscores (%5F) and other special characters when specifying the name extra parameter. Change-Id: Ida346d35bb7e7a328bff82daa543009a2ae250ae --- M api/ApiQueryGeoSearchDb.php 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GeoData refs/changes/26/76926/1 diff --git a/api/ApiQueryGeoSearchDb.php b/api/ApiQueryGeoSearchDb.php index d21ce65..042d744 100644 --- a/api/ApiQueryGeoSearchDb.php +++ b/api/ApiQueryGeoSearchDb.php @@ -73,8 +73,11 @@ foreach( $params['prop'] as $prop ) { if ( isset( Coord::$fieldMapping[$prop] ) && isset( $row->{Coord::$fieldMapping[$prop]} ) ) { $field = Coord::$fieldMapping[$prop]; + // If prop is name, urldecode + if ( $prop === 'name' ) { + $vals[$prop] = urldecode($row->$field); // Don't output default globe - if ( !( $prop === 'globe' && $row->$field === $wgDefaultGlobe ) ) { + } elseif ( !( $prop === 'globe' && $row->$field === $wgDefaultGlobe ) ) { $vals[$prop] = $row->$field; } } -- To view, visit https://gerrit.wikimedia.org/r/76926 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ida346d35bb7e7a328bff82daa543009a2ae250ae Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/GeoData Gerrit-Branch: master Gerrit-Owner: Jqnatividad <joel.nativi...@ontodia.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits