Make WordPress Core


Ignore:
Timestamp:
04/16/2023 10:46:17 AM (4 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison where substr() is involved.

Follow-up to [3606], [10738], [33359], [55642], [55652].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.

File:
1 edited

Legend:

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

    r55642 r55653  
    948948
    949949        $order = 'ASC';
    950         if ( substr($orderby, 0, 1) == '_' ) {
     950        if ( substr($orderby, 0, 1) === '_' ) {
    951951                $order = 'DESC';
    952952                $orderby = substr($orderby, 1);
    … …  
    981981
    982982                if ( $show_updated )
    983                         if (substr($row->link_updated_f, 0, 2) != '00')
     983                        if (substr($row->link_updated_f, 0, 2) !== '00')
    984984                                $title .= ' ('.__('Last updated') . ' ' . gmdate(get_option('links_updated_date_format'), $row->link_updated_f + (get_option('gmt_offset') * HOUR_IN_SECONDS)) . ')';
    985985
    … …  
    10431043        // Handle link category sorting.
    10441044        $direction = 'ASC';
    1045         if ( '_' == substr($order,0,1) ) {
     1045        if ( '_' === substr($order,0,1) ) {
    10461046                $direction = 'DESC';
    10471047                $order = substr($order,1);
    … …  
    17401740                $link_text = $matches[4][$i];
    17411741                $content = str_replace( $link_match, $link_text . ' ' . $link_number, $content );
    1742                 $link_url = ( ( strtolower( substr( $link_url, 0, 7 ) ) != 'http://' ) && ( strtolower( substr( $link_url, 0, 8 ) ) != 'https://' ) ) ? get_option( 'home' ) . $link_url : $link_url;
     1742                $link_url = ( ( strtolower( substr( $link_url, 0, 7 ) ) !== 'http://' ) && ( strtolower( substr( $link_url, 0, 8 ) ) !== 'https://' ) ) ? get_option( 'home' ) . $link_url : $link_url;
    17431743                $links_summary .= "\n" . $link_number . ' ' . $link_url;
    17441744        }
Note: See TracChangeset for help on using the changeset viewer.