Page MenuHomePhabricator

[BUG] Error trying to edit page 中國新歌聲_(第一季) in Simplified Chinese on API 23
Closed, InvalidPublic1 Story Points

Description

There appears to be an encoding issue somewhere here and we're sending a malformed page title in the API request to fetch wikitext (it's truncated at the first paren):

https://zh.wikipedia.org/w/api.php?action=query&format=json&prop=revisions&rvprop=content&rvlimit=1&titles=%E4%B8%AD%E5%9B%BD%E6%96%B0%E6%AD%8C%E5%A3%B0_

Note that this doesn't happen for other languages (including Trad Chinese), or even other pages with in-title parens in Simplified Chinese...

Steps to reproduce

  1. Navigate to 中國新歌聲_(第一季)
  2. Click an edit button

Expected results

The editing activity opens

Actual results

An error is returned

Stack trace

10-13 14:46:36.464 3393-3393/org.wikipedia.dev I/org.wikipedia.concurrency.SaneAsyncTask: 
  onPostExecute():71: java.lang.NullPointerException: Attempt to invoke virtual method 'org.json.JSONObject org.json.JSONArray.getJSONObject(int)' on a null object reference
    at org.wikipedia.editing.FetchSectionWikitextTask.processResult(FetchSectionWikitextTask.java:39)
    at org.wikipedia.editing.FetchSectionWikitextTask.processResult(FetchSectionWikitextTask.java:12)
    at org.wikipedia.ApiTask.performTask(ApiTask.java:31)
    at org.wikipedia.concurrency.SaneAsyncTask.doInBackground(SaneAsyncTask.java:57)
    at org.wikipedia.concurrency.SaneAsyncTask.doInBackground(SaneAsyncTask.java:16)
    at android.os.AsyncTask$2.call(AsyncTask.java:295)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
    at java.lang.Thread.run(Thread.java:818)

Environments observed

App version: all
Android OS versions: all
Device model: all
Device language: all