Last modified: 2012-11-07 03:36:57 UTC
If I try to use api.php?action=ask with query witch contains || (disjunction) then script returns unexpected result. I fix it with little patch: File: /extensions/SemanticMediaWiki/includes/api/ApiAsk.php Line: 21 Replace: $rawParams = explode( '|', $params['query'] ); With: $rawParams = preg_split("/(?<=[^\|])\|(?=[^\|])/", $params['query']); Description: this happens because script tries to split query string with pipe char, but it can contain doblepipe char to concat results (e.g. [[Category:First||Second]]), so it would be better to use preg_split as I propose.
Hi Maxim, thanks for the report and the solution! You are welcome to use Developer access https://www.mediawiki.org/wiki/Developer_access to submit this as a Git branch directly into Gerrit: https://www.mediawiki.org/wiki/Git/Tutorial Putting your branch in Git makes it easier for us to review it quickly. Thanks again! We appreciate your contribution.
Jeroen included the patch https://gerrit.wikimedia.org/r/#/c/31742/