Make WordPress Core


Ignore:
Timestamp:
06/17/2023 10:26:24 AM (15 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison in wp-includes/pomo/mo.php.

Follow-up to [10584], [12174].

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

File:
1 edited

Legend:

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

    r53957 r55931  
    207207            // 0xde120495
    208208            $magic_big = ( (int) - 569244523 ) & 0xFFFFFFFF;
    209             if ( $magic_little == $magic || $magic_little_64 == $magic ) {
     209            if ( $magic_little === $magic || $magic_little_64 === $magic ) {
    210210                return 'little';
    211             } elseif ( $magic_big == $magic ) {
     211            } elseif ( $magic_big === $magic ) {
    212212                return 'big';
    213213            } else {
     
    230230
    231231            $header = $reader->read( 24 );
    232             if ( $reader->strlen( $header ) != 24 ) {
     232            if ( $reader->strlen( $header ) !== 24 ) {
    233233                return false;
    234234            }
     
    241241
    242242            // Support revision 0 of MO format specs, only.
    243             if ( 0 != $header['revision'] ) {
     243            if ( 0 !== $header['revision'] ) {
    244244                return false;
    245245            }
     
    250250            // Read originals' indices.
    251251            $originals_lengths_length = $header['translations_lengths_addr'] - $header['originals_lengths_addr'];
    252             if ( $originals_lengths_length != $header['total'] * 8 ) {
     252            if ( $originals_lengths_length !== $header['total'] * 8 ) {
    253253                return false;
    254254            }
    255255
    256256            $originals = $reader->read( $originals_lengths_length );
    257             if ( $reader->strlen( $originals ) != $originals_lengths_length ) {
     257            if ( $reader->strlen( $originals ) !== $originals_lengths_length ) {
    258258                return false;
    259259            }
     
    261261            // Read translations' indices.
    262262            $translations_lengths_length = $header['hash_addr'] - $header['translations_lengths_addr'];
    263             if ( $translations_lengths_length != $header['total'] * 8 ) {
     263            if ( $translations_lengths_length !== $header['total'] * 8 ) {
    264264                return false;
    265265            }
    266266
    267267            $translations = $reader->read( $translations_lengths_length );
    268             if ( $reader->strlen( $translations ) != $translations_lengths_length ) {
     268            if ( $reader->strlen( $translations ) !== $translations_lengths_length ) {
    269269                return false;
    270270            }
Note: See TracChangeset for help on using the changeset viewer.