Make WordPress Core


Ignore:
Timestamp:
04/05/2020 03:00:44 AM (4 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/embed.php

    r47219 r47550  
    801801 */
    802802function wp_filter_oembed_iframe_title_attribute( $result, $data, $url ) {
    803     if ( false === $result || ! in_array( $data->type, array( 'rich', 'video' ) ) ) {
     803    if ( false === $result || ! in_array( $data->type, array( 'rich', 'video' ), true ) ) {
    804804        return $result;
    805805    }
     
    855855 */
    856856function wp_filter_oembed_result( $result, $data, $url ) {
    857     if ( false === $result || ! in_array( $data->type, array( 'rich', 'video' ) ) ) {
     857    if ( false === $result || ! in_array( $data->type, array( 'rich', 'video' ), true ) ) {
    858858        return $result;
    859859    }
Note: See TracChangeset for help on using the changeset viewer.