[wp-trac] [WordPress Trac] #46024: Make version_compare for Servehappy more robust

WordPress Trac noreply at wordpress.org
Thu Jan 17 18:14:26 UTC 2019


#46024: Make version_compare for Servehappy more robust
-------------------------+-------------------------------------------------
 Reporter:  afragen      |      Owner:  (none)
     Type:  defect       |     Status:  new
  (bug)                  |
 Priority:  normal       |  Milestone:  Awaiting Review
Component:               |    Version:  trunk
  Upgrade/Install        |   Keywords:  has-patch servehappy dev-feedback
 Severity:  normal       |  needs-testing
  Focuses:               |
-------------------------+-------------------------------------------------
 As discussed in #core-php
 [https://wordpress.slack.com/archives/C60K3MP2Q/p1546880250090100] there's
 a potential problem with the current version_compare for testing
 compatibility with WordPress or PHP version numbers.

 Using the current test `version_compare( substr( phpversion(), 0, strlen(
 $requires ) ), $requires, '>=' )` if the current version is `5.1.10` and
 the required version is `5.1.2`, the above will evaluate to false when it
 should be true.

 Simplifying the test to `version_compare( phpversion(), $requires, '>=' )`
 evaluates to true, as it should.

 This test was added in [https://core.trac.wordpress.org/changeset/43436
 r43436]

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46024>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list