Page MenuHomePhabricator

Write a version_compare that handles wmfN correctly
Closed, DeclinedPublic

Description

Author: Bryan.TongMinh

Description:
According to version_compare() 1.17wmf1 < 1.17alpha. We need our own wfVersionCompare() that handles such cases properly. We could probably even have a function wfIsAtLeastMediaWiki() or something similar.

Additional note: Apparently also 1.17alpha < 1.17, which I am not sure is desirable.


Version: unspecified
Severity: enhancement

Details

Reference
bz27248

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:18 PM
bzimport set Reference to bz27248.
bzimport added a subscriber: Unknown Object (MLST).

Apparently also 1.17alpha < 1.17, which I am not sure is desirable.

The alpha version is pre-release, while the version without the "alpha" is later, so I think that is right.

(In reply to comment #0)

According to version_compare() 1.17wmf1 < 1.17alpha. We need our own
wfVersionCompare() that handles such cases properly. We could probably even
have a function wfIsAtLeastMediaWiki() or something similar.

Per the PHP docs, anything it can't sort automatically comes "older."

"any string not found in this list < dev < alpha = a < beta = b < RC = rc < # < pl = p."

Additional note: Apparently also 1.17alpha < 1.17, which I am not sure is
desirable.

This is as designed, like Mark says :)

I have no idea what would be "correct", wmf numbering and pre releases are disconnected and there is no way to find out which is the most recent. I don't think it make any sense to compare them and would prefer we avoid adding yet another global function.