Last modified: 2012-12-09 19:49:08 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T29248, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 27248 - Write a version_compare that handles wmfN correctly
Write a version_compare that handles wmfN correctly
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-08 09:20 UTC by Bryan Tong Minh
Modified: 2012-12-09 19:49 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Bryan Tong Minh 2011-02-08 09:20:54 UTC
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.
Comment 1 Mark A. Hershberger 2011-02-08 22:10:27 UTC
> 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.
Comment 2 Chad H. 2011-02-09 13:37:12 UTC
(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 :)
Comment 3 Antoine "hashar" Musso (WMF) 2012-12-09 19:49:08 UTC
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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links