Make WordPress Core


Ignore:
Timestamp:
07/06/2021 01:51:05 PM (3 years ago)
Author:
desrosj
Message:

I18N: Correct recurring lenghts typo.

Props mikaelmayer.
Fixes #53600.

File:
1 edited

Legend:

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

    r49184 r51342  
    103103            $revision                  = 0;
    104104            $total                     = count( $entries ) + 1; // All the headers are one entry.
    105             $originals_lenghts_addr    = 28;
    106             $translations_lenghts_addr = $originals_lenghts_addr + 8 * $total;
     105            $originals_lengths_addr    = 28;
     106            $translations_lengths_addr = $originals_lengths_addr + 8 * $total;
    107107            $size_of_hash              = 0;
    108             $hash_addr                 = $translations_lenghts_addr + 8 * $total;
     108            $hash_addr                 = $translations_lengths_addr + 8 * $total;
    109109            $current_addr              = $hash_addr;
    110110            fwrite(
     
    115115                    $revision,
    116116                    $total,
    117                     $originals_lenghts_addr,
    118                     $translations_lenghts_addr,
     117                    $originals_lengths_addr,
     118                    $translations_lengths_addr,
    119119                    $size_of_hash,
    120120                    $hash_addr
    121121                )
    122122            );
    123             fseek( $fh, $originals_lenghts_addr );
     123            fseek( $fh, $originals_lengths_addr );
    124124
    125125            // Headers' msgid is an empty string.
     
    230230
    231231            // Parse header.
    232             $header = unpack( "{$endian}revision/{$endian}total/{$endian}originals_lenghts_addr/{$endian}translations_lenghts_addr/{$endian}hash_length/{$endian}hash_addr", $header );
     232            $header = unpack( "{$endian}revision/{$endian}total/{$endian}originals_lengths_addr/{$endian}translations_lengths_addr/{$endian}hash_length/{$endian}hash_addr", $header );
    233233            if ( ! is_array( $header ) ) {
    234234                return false;
     
    241241
    242242            // Seek to data blocks.
    243             $reader->seekto( $header['originals_lenghts_addr'] );
     243            $reader->seekto( $header['originals_lengths_addr'] );
    244244
    245245            // Read originals' indices.
    246             $originals_lengths_length = $header['translations_lenghts_addr'] - $header['originals_lenghts_addr'];
     246            $originals_lengths_length = $header['translations_lengths_addr'] - $header['originals_lengths_addr'];
    247247            if ( $originals_lengths_length != $header['total'] * 8 ) {
    248248                return false;
     
    255255
    256256            // Read translations' indices.
    257             $translations_lenghts_length = $header['hash_addr'] - $header['translations_lenghts_addr'];
    258             if ( $translations_lenghts_length != $header['total'] * 8 ) {
    259                 return false;
    260             }
    261 
    262             $translations = $reader->read( $translations_lenghts_length );
    263             if ( $reader->strlen( $translations ) != $translations_lenghts_length ) {
     257            $translations_lengths_length = $header['hash_addr'] - $header['translations_lengths_addr'];
     258            if ( $translations_lengths_length != $header['total'] * 8 ) {
     259                return false;
     260            }
     261
     262            $translations = $reader->read( $translations_lengths_length );
     263            if ( $reader->strlen( $translations ) != $translations_lengths_length ) {
    264264                return false;
    265265            }
Note: See TracChangeset for help on using the changeset viewer.