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.

git-svn-id: https://develop.svn.wordpress.org/trunk@55652 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2023-04-15 12:09:08 +00:00
parent 94f1eb31c4
commit 760728c92f
4 changed files with 11 additions and 7 deletions

View File

@@ -898,7 +898,7 @@ function seems_utf8( $str ) {
return false; // Does not match any model.
}
for ( $j = 0; $j < $n; $j++ ) { // n bytes matching 10bbbbbb follow ?
if ( ( ++$i == $length ) || ( ( ord( $str[ $i ] ) & 0xC0 ) != 0x80 ) ) {
if ( ( ++$i === $length ) || ( ( ord( $str[ $i ] ) & 0xC0 ) != 0x80 ) ) {
return false;
}
}
@@ -5138,7 +5138,7 @@ function wp_sprintf( $pattern, ...$args ) {
$arg_index = 0;
while ( $len > $start ) {
// Last character: append and break.
if ( strlen( $pattern ) - 1 == $start ) {
if ( strlen( $pattern ) - 1 === $start ) {
$result .= substr( $pattern, -1 );
break;
}