Coding Standards: Use strict type check for in_array() and array_search().

This addresses all the remaining `WordPress.PHP.StrictInArray.MissingTrueStrict` issues in core.

Includes minor code layout fixes for better readability.

Follow-up to [47550].

See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@47557 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2020-04-09 15:41:04 +00:00
parent 3df79c3380
commit d8c502e966
28 changed files with 172 additions and 77 deletions

View File

@@ -192,7 +192,7 @@ class WP_Http_Cookie {
}
// Port - supports "port-lists" in the format: "80,8000,8080".
if ( ! empty( $port ) && ! in_array( $url['port'], explode( ',', $port ) ) ) {
if ( ! empty( $port ) && ! in_array( $url['port'], array_map( 'intval', explode( ',', $port ) ), true ) ) {
return false;
}