[wp-trac] [WordPress Trac] #20416: Install plugins version checking not correct

WordPress Trac wp-trac at lists.automattic.com
Wed Apr 11 11:23:02 UTC 2012


#20416: Install plugins version checking not correct
----------------------------+-----------------------------
 Reporter:  Workshopshed    |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Administration  |    Version:  3.4
 Severity:  minor           |   Keywords:
----------------------------+-----------------------------
 The version checking does not seem to be treating the numbers in the same
 way a person would, when I view the "details" the screen says:

 Newer Version (1.63) Installed
 FYI
 Version: 1.7

 Surely 1.7 is newer than 1.63.

 Looking in the code I see that install_plugin_install_status is the
 function that manages this which is in wp-admin\includes\plugin-
 install.php

 That in turn uses "version_compare" to check the versions. Experimenting
 with that function which is a php function it would seem that:


 {{{
 version_compare('1.7','1.63', '<')    = true
 version_compare('1.7','1.6', '<')     = false
 version_compare('1.70','1.60', '<')   = false
 version_compare('1.70','1.63', '<')   = false
 }}}


 So a work around for this is to ensure that people use a standarised
 numbering convention. This behaviour has been there since 3.0.0.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20416>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list