Page MenuHomePhabricator

Unary minus is buggy
Open, Needs TriagePublic

Description

Steps to Reproduce:

Run:

(-[])===(-[])

Actual Results:

{
    "error": {
        "code": "internal_api_error_Error",
        "info": "[XcH85gpAIDgAAKzMO6QAAABQ] Caught exception of type Error",
        "errorclass": "Error"
    },
    "servedby": "mw1344"
}

Expected Results:

true

Discussion:

https://phabricator.wikimedia.org/diffusion/EABF/browse/master/includes/parser/AFPData.php$232-233 is incorrect. With the way it currently is, it's possible to construct a value of type DARRAY whose value is actually a float. So when we do operations that expect a DARRAY, an error occurs.

Event Timeline

It seems I used a wrong bug reporting form. Sorry :/

Change 548972 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Unary minus should return float when the value is not int, undef or empty

https://gerrit.wikimedia.org/r/548972

Daimona subscribed.