https://bugzilla.wikimedia.org/show_bug.cgi?id=41746

       Web browser: ---
             Bug #: 41746
           Summary: Ask API bug
           Product: MediaWiki extensions
           Version: master
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Unprioritized
         Component: Semantic MediaWiki
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified
   Mobile Platform: ---


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.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to