Make WordPress Core

Ticket #59448: 59448.patch

File 59448.patch, 1.5 KB (added by sessioncookiemonster, 18 months ago)

Patch for this

  • src/wp-includes/functions.php

    diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php
    index cb490ee176..c6a295802b 100644
    a b function clean_dirsize_cache( $path ) { 
    87138713function is_wp_version_compatible( $required ) {
    87148714        global $wp_version;
    87158715
     8716        $valid_required = preg_replace( '/^(\d+)\.(\d+)\.0$/','$1.$2',$required );
     8717        if( is_string( $required ) && $valid_required !== $required ) {
     8718                _doing_it_wrong( __FUNCTION__,'Invalid version string','X.X' );
     8719                $required = $valid_required;
     8720        }
     8721
    87168722        // Strip off any -alpha, -RC, -beta, -src suffixes.
    87178723        list( $version ) = explode( '-', $wp_version );
    87188724
  • tests/phpunit/tests/functions/isWpVersionCompatible.php

    diff --git a/tests/phpunit/tests/functions/isWpVersionCompatible.php b/tests/phpunit/tests/functions/isWpVersionCompatible.php
    index a6491b66e8..46d1f16e03 100644
    a b class Tests_Functions_IsWpVersionCompatible extends WP_UnitTestCase { 
    182182                        ),
    183183                );
    184184        }
     185
     186        /**
     187         * Tests is_wp_version_compatible() with invalid version notation like x.y.0.
     188         *
     189         * @expectedIncorrectUsage is_wp_version_compatible
     190         */
     191        public function test_is_wp_version_compatible_with_wrong_version_notation() {
     192                global $wp_version;
     193                $wp_version = '6.3';
     194                $this->assertSame( true, is_wp_version_compatible( '6.3.0' ) );
     195                $wp_version = '6.3.1';
     196                $this->assertSame( false, is_wp_version_compatible( '6.3.2' ) );
     197        }
    185198}