Coding Standards: Use strict comparison in `wp-includes/pomo/mo.php`.
Follow-up to [10584], [12174]. Props aristath, poena, afercia, SergeyBiryukov. See #57839. Built from https://develop.svn.wordpress.org/trunk@55931 git-svn-id: http://core.svn.wordpress.org/trunk@55443 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8b93938860
commit
df4c8c8497
|
@ -206,9 +206,9 @@ if ( ! class_exists( 'MO', false ) ) :
|
||||||
$magic_little_64 = (int) 2500072158;
|
$magic_little_64 = (int) 2500072158;
|
||||||
// 0xde120495
|
// 0xde120495
|
||||||
$magic_big = ( (int) - 569244523 ) & 0xFFFFFFFF;
|
$magic_big = ( (int) - 569244523 ) & 0xFFFFFFFF;
|
||||||
if ( $magic_little == $magic || $magic_little_64 == $magic ) {
|
if ( $magic_little === $magic || $magic_little_64 === $magic ) {
|
||||||
return 'little';
|
return 'little';
|
||||||
} elseif ( $magic_big == $magic ) {
|
} elseif ( $magic_big === $magic ) {
|
||||||
return 'big';
|
return 'big';
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
@ -229,7 +229,7 @@ if ( ! class_exists( 'MO', false ) ) :
|
||||||
$endian = ( 'big' === $endian_string ) ? 'N' : 'V';
|
$endian = ( 'big' === $endian_string ) ? 'N' : 'V';
|
||||||
|
|
||||||
$header = $reader->read( 24 );
|
$header = $reader->read( 24 );
|
||||||
if ( $reader->strlen( $header ) != 24 ) {
|
if ( $reader->strlen( $header ) !== 24 ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,7 +240,7 @@ if ( ! class_exists( 'MO', false ) ) :
|
||||||
}
|
}
|
||||||
|
|
||||||
// Support revision 0 of MO format specs, only.
|
// Support revision 0 of MO format specs, only.
|
||||||
if ( 0 != $header['revision'] ) {
|
if ( 0 !== $header['revision'] ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -249,23 +249,23 @@ if ( ! class_exists( 'MO', false ) ) :
|
||||||
|
|
||||||
// Read originals' indices.
|
// Read originals' indices.
|
||||||
$originals_lengths_length = $header['translations_lengths_addr'] - $header['originals_lengths_addr'];
|
$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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$originals = $reader->read( $originals_lengths_length );
|
$originals = $reader->read( $originals_lengths_length );
|
||||||
if ( $reader->strlen( $originals ) != $originals_lengths_length ) {
|
if ( $reader->strlen( $originals ) !== $originals_lengths_length ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read translations' indices.
|
// Read translations' indices.
|
||||||
$translations_lengths_length = $header['hash_addr'] - $header['translations_lengths_addr'];
|
$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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$translations = $reader->read( $translations_lengths_length );
|
$translations = $reader->read( $translations_lengths_length );
|
||||||
if ( $reader->strlen( $translations ) != $translations_lengths_length ) {
|
if ( $reader->strlen( $translations ) !== $translations_lengths_length ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.3-alpha-55930';
|
$wp_version = '6.3-alpha-55931';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue