mediawiki.searchSuggest: Use formatversion=2 for API requests
authorFomafix <fomafix@googlemail.com>
Mon, 25 Jan 2016 19:15:59 +0000 (19:15 +0000)
committerKrinkle <krinklemail@gmail.com>
Tue, 26 Jan 2016 03:37:28 +0000 (03:37 +0000)
With formatversion=2 the response uses UTF-8 instead of escape sequences
with hex for encoding of non-ASCII characters (e.g. "\u00e4" for "รค").

The other syntax changes of formatversion=2 have no effect here.

Change-Id: Ib01497e8a2340d329482b5131a125b1f92e87116

resources/src/mediawiki/mediawiki.searchSuggest.js

index ada4924..0fcd22c 100644 (file)
@@ -6,6 +6,7 @@
                // queries the wiki and calls response with the result
                request: function ( api, query, response, maxRows ) {
                        return api.get( {
+                               formatversion: 2,
                                action: 'opensearch',
                                search: query,
                                namespace: 0,