mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Coding Standards: Use Yoda condition in str_ends_with().
This resolves a WPCS error:
{{{
Use Yoda Condition checks, you must.
}}}
Follow-up to [56015], [56016].
See #58220.
git-svn-id: https://develop.svn.wordpress.org/trunk@56017 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
0fd9ee91ec
commit
ffc386bfbd
@ -488,7 +488,7 @@ if ( ! function_exists( 'str_ends_with' ) ) {
|
||||
|
||||
$len = strlen( $needle );
|
||||
|
||||
return $needle === substr( $haystack, -$len, $len );
|
||||
return substr( $haystack, -$len, $len ) === $needle;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user