[wp-trac] [WordPress Trac] #61781: Use unadulterated WP version in `is_wp_version_compatible()`

WordPress Trac noreply at wordpress.org
Mon Jul 29 01:10:15 UTC 2024


#61781: Use unadulterated WP version in `is_wp_version_compatible()`
---------------------------+-----------------------------
 Reporter:  peterwilsoncc  |      Owner:  costdev
     Type:  defect (bug)   |     Status:  assigned
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  General        |    Version:
 Severity:  normal         |   Keywords:
  Focuses:                 |
---------------------------+-----------------------------
 Follow up to #61627.

 In [58813] the helper function `wp_get_wp_version()` was introduced as a
 way of getting the WordPress version without relying on the `$wp_version`
 global. This is to bypass bugs introduced by plugins modifying the value
 for reasons of security through obscurity.

 As `is_wp_version_compatible()` currently uses the `$wp_version` global,
 such a plugin would affect and break the function. Now a helper function
 exists for getting the unmodified value it would be good to use it.

 Test suite considerations: The tests for `is_wp_version_compatible()`
 currently modify the value of the WordPress version in order to test that
 the function works as expected with alpha, beta, RC and WordPress-Develop.
 The code will need to be written in such a way that this can continue to
 be tested.

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


More information about the wp-trac mailing list