Skip to content

Commit

Permalink
fix substr_count
Browse files Browse the repository at this point in the history
  • Loading branch information
afragen committed Nov 16, 2023
1 parent 4eb9190 commit 54e7518
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/wp-includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -8716,15 +8716,14 @@ function is_wp_version_compatible( $required ) {
// Strip off any -alpha, -RC, -beta, -src suffixes.
list( $version ) = explode( '-', $wp_version );

if ( is_string( $required ) && substr_count( $required, '.' ) > 2 && str_ends_with( $required, '.0' ) ) {
if ( is_string( $required ) && substr_count( $required, '.' ) > 1 && str_ends_with( $required, '.0' ) ) {
$required = rtrim( $required, '.0' );

wp_trigger_error(
__FUNCTION__,
'Not a valid WordPress version string.',
E_USER_NOTICE
);

}

return empty( $required ) || version_compare( $version, $required, '>=' );
Expand Down

0 comments on commit 54e7518

Please sign in to comment.