mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Coding Standards: Use strict comparison in wp-includes/pomo/mo.php.
Follow-up to [10584], [12174]. Props aristath, poena, afercia, SergeyBiryukov. See #57839. git-svn-id: https://develop.svn.wordpress.org/trunk@55931 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
3e2121c83d
commit
fbef5030f6
@ -206,9 +206,9 @@ if ( ! class_exists( 'MO', false ) ) :
|
||||
$magic_little_64 = (int) 2500072158;
|
||||
// 0xde120495
|
||||
$magic_big = ( (int) - 569244523 ) & 0xFFFFFFFF;
|
||||
if ( $magic_little == $magic || $magic_little_64 == $magic ) {
|
||||
if ( $magic_little === $magic || $magic_little_64 === $magic ) {
|
||||
return 'little';
|
||||
} elseif ( $magic_big == $magic ) {
|
||||
} elseif ( $magic_big === $magic ) {
|
||||
return 'big';
|
||||
} else {
|
||||
return false;
|
||||
@ -229,7 +229,7 @@ if ( ! class_exists( 'MO', false ) ) :
|
||||
$endian = ( 'big' === $endian_string ) ? 'N' : 'V';
|
||||
|
||||
$header = $reader->read( 24 );
|
||||
if ( $reader->strlen( $header ) != 24 ) {
|
||||
if ( $reader->strlen( $header ) !== 24 ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -240,7 +240,7 @@ if ( ! class_exists( 'MO', false ) ) :
|
||||
}
|
||||
|
||||
// Support revision 0 of MO format specs, only.
|
||||
if ( 0 != $header['revision'] ) {
|
||||
if ( 0 !== $header['revision'] ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -249,23 +249,23 @@ if ( ! class_exists( 'MO', false ) ) :
|
||||
|
||||
// Read originals' indices.
|
||||
$originals_lengths_length = $header['translations_lengths_addr'] - $header['originals_lengths_addr'];
|
||||
if ( $originals_lengths_length != $header['total'] * 8 ) {
|
||||
if ( $originals_lengths_length !== $header['total'] * 8 ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$originals = $reader->read( $originals_lengths_length );
|
||||
if ( $reader->strlen( $originals ) != $originals_lengths_length ) {
|
||||
if ( $reader->strlen( $originals ) !== $originals_lengths_length ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Read translations' indices.
|
||||
$translations_lengths_length = $header['hash_addr'] - $header['translations_lengths_addr'];
|
||||
if ( $translations_lengths_length != $header['total'] * 8 ) {
|
||||
if ( $translations_lengths_length !== $header['total'] * 8 ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$translations = $reader->read( $translations_lengths_length );
|
||||
if ( $reader->strlen( $translations ) != $translations_lengths_length ) {
|
||||
if ( $reader->strlen( $translations ) !== $translations_lengths_length ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user