mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Code Modernization: Use str_ends_with() in a few more places.
`str_ends_with()` was introduced in PHP 8.0 to perform a case-sensitive check indicating if the string to search in (haystack) ends with the given substring (needle). WordPress core includes a polyfill for `str_ends_with()` on PHP < 8.0 as of WordPress 5.9. Follow-up to [55990]. See #58220. git-svn-id: https://develop.svn.wordpress.org/trunk@56014 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -877,7 +877,7 @@ function wp_get_active_and_valid_plugins() {
|
||||
|
||||
foreach ( $active_plugins as $plugin ) {
|
||||
if ( ! validate_file( $plugin ) // $plugin must validate as file.
|
||||
&& '.php' === substr( $plugin, -4 ) // $plugin must end with '.php'.
|
||||
&& str_ends_with( $plugin, '.php' ) // $plugin must end with '.php'.
|
||||
&& file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist.
|
||||
// Not already included as a network plugin.
|
||||
&& ( ! $network_plugins || ! in_array( WP_PLUGIN_DIR . '/' . $plugin, $network_plugins, true ) )
|
||||
|
||||
Reference in New Issue
Block a user