API: Allow to pass whitespaces in MultiValue
authorFomafix <fomafix@googlemail.com>
Sun, 21 Jan 2018 20:58:59 +0000 (21:58 +0100)
committerFomafix <fomafix@googlemail.com>
Sun, 28 Jan 2018 18:05:07 +0000 (19:05 +0100)
commitb8f97035cefbe63f2cb8ce1aa2f2d47f57c008c9
treee7c74461a4f8abd497f6862df2fec930d8b796e6
parentaf431ec783e66c12d6693d638029a9f912c14541
API: Allow to pass whitespaces in MultiValue

This allows to response with an invalidreason instead silently ignore
the parameter.

Example request: api.php?format=json&action=query&titles=%20

Response before this change:
{
  "batchcomplete": ""
}

Response with this change:
{
  "batchcomplete": "",
  "query": {
    "pages": {
      "-1": {
        "title": " ",
        "invalidreason": "The requested page title is empty or contains only the name of a namespace.",
        "invalid": ""
      }
    }
  }
}

Bug: T185846
Change-Id: I6fdaf32792a0e6e37b08176f975c10607093351b
includes/api/ApiBase.php
tests/phpunit/includes/api/query/ApiQueryTest.php