[wp-trac] [WordPress Trac] #61627: Introduce helper function get the unmodified value of `$wp_version`.

WordPress Trac noreply at wordpress.org
Sat Jul 27 00:26:00 UTC 2024


#61627: Introduce helper function get the unmodified value of `$wp_version`.
---------------------------------------------+---------------------
 Reporter:  peterwilsoncc                    |       Owner:  (none)
     Type:  enhancement                      |      Status:  new
 Priority:  normal                           |   Milestone:  6.7
Component:  General                          |     Version:
 Severity:  normal                           |  Resolution:
 Keywords:  has-patch has-unit-tests commit  |     Focuses:
---------------------------------------------+---------------------

Comment (by peterwilsoncc):

 In [changeset:"58813" 58813]:
 {{{
 #!CommitTicketReference repository="" revision="58813"
 General: Introduce `wp_get_wp_version()` to get unmodified version.

 Introduces `wp_get_wp_version()` to get an unmodified value of
 `$wp_version` from `wp-includes/version.php`. Some plugins modify the
 global in an attempt to improve security through obscurity. This practice
 can cause errors in WordPress so the ability to get an unmodified version
 is needed.

 Replaces instances within the code base in which `version.php` was
 required in order to get an unmodified value. `script-loader.php` is
 intentionally excluded from the replacements as the function is not always
 available to the file.

 Props debarghyabanerjee, afragen, costdev.
 See #61627.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61627#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list