mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-06 18:20:08 +00:00
Coding Standards: Use strict type check for in_array() and array_search() where strings are involved.
This reduces the number of `WordPress.PHP.StrictInArray.MissingTrueStrict` issues from 486 to 50. Includes minor code layout fixes for better readability. See #49542. git-svn-id: https://develop.svn.wordpress.org/trunk@47550 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1208,12 +1208,12 @@ function _get_path_to_translation_from_lang_dir( $domain ) {
|
||||
$mofile = "{$domain}-{$locale}.mo";
|
||||
|
||||
$path = WP_LANG_DIR . '/plugins/' . $mofile;
|
||||
if ( in_array( $path, $cached_mofiles ) ) {
|
||||
if ( in_array( $path, $cached_mofiles, true ) ) {
|
||||
return $path;
|
||||
}
|
||||
|
||||
$path = WP_LANG_DIR . '/themes/' . $mofile;
|
||||
if ( in_array( $path, $cached_mofiles ) ) {
|
||||
if ( in_array( $path, $cached_mofiles, true ) ) {
|
||||
return $path;
|
||||
}
|
||||
|
||||
@@ -1366,7 +1366,7 @@ function wp_get_installed_translations( $type ) {
|
||||
if ( ! preg_match( '/(?:(.+)-)?([a-z]{2,3}(?:_[A-Z]{2})?(?:_[a-z0-9]+)?).po/', $file, $match ) ) {
|
||||
continue;
|
||||
}
|
||||
if ( ! in_array( substr( $file, 0, -3 ) . '.mo', $files ) ) {
|
||||
if ( ! in_array( substr( $file, 0, -3 ) . '.mo', $files, true ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user