Coding Standards: Use strict type check for in_array() in wp-includes/feed.php.

Additionally:
* Correct inline comments per the documentation standards.
* Correct the `@ticket` reference in `tests/feed/atom.php`.

Follow-up to [48429].

See #33591.

git-svn-id: https://develop.svn.wordpress.org/trunk@48435 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2020-07-11 12:12:46 +00:00
parent 8dc7f1c348
commit b4232b7de7
2 changed files with 16 additions and 10 deletions

View File

@@ -526,17 +526,17 @@ function atom_enclosure() {
$mimes = get_allowed_mime_types();
// Parse url
// Parse URL.
if ( isset( $enclosure[0] ) && is_string( $enclosure[0] ) ) {
$url = trim( $enclosure[0] );
}
// Parse length and type
foreach ( range( 1, 2 ) as $i ) {
// Parse length and type.
for ( $i = 1; $i <= 2; $i++ ) {
if ( isset( $enclosure[ $i ] ) ) {
if ( is_numeric( $enclosure[ $i ] ) ) {
$length = trim( $enclosure[ $i ] );
} elseif ( in_array( $enclosure[ $i ], $mimes ) ) {
} elseif ( in_array( $enclosure[ $i ], $mimes, true ) ) {
$type = trim( $enclosure[ $i ] );
}
}
@@ -548,6 +548,7 @@ function atom_enclosure() {
esc_attr( $length ),
esc_attr( $type )
);
/**
* Filters the atom enclosure HTML link tag for the current post.
*