Make WordPress Core


Ignore:
Timestamp:
04/15/2023 12:09:08 PM (16 months ago)
Author:
SergeyBiryukov
Message:

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

Follow-up to [649], [1345], [3034], [6132], [6314], [6974], [55642].

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

File:
1 edited

Legend:

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

    r55651 r55652  
    899899        }
    900900        for ( $j = 0; $j < $n; $j++ ) { // n bytes matching 10bbbbbb follow ?
    901             if ( ( ++$i == $length ) || ( ( ord( $str[ $i ] ) & 0xC0 ) != 0x80 ) ) {
     901            if ( ( ++$i === $length ) || ( ( ord( $str[ $i ] ) & 0xC0 ) != 0x80 ) ) {
    902902                return false;
    903903            }
     
    51395139    while ( $len > $start ) {
    51405140        // Last character: append and break.
    5141         if ( strlen( $pattern ) - 1 == $start ) {
     5141        if ( strlen( $pattern ) - 1 === $start ) {
    51425142            $result .= substr( $pattern, -1 );
    51435143            break;
Note: See TracChangeset for help on using the changeset viewer.