Changeset 51342 for trunk/src/wp-includes/pomo/mo.php
- Timestamp:
- 07/06/2021 01:51:05 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/pomo/mo.php
r49184 r51342 103 103 $revision = 0; 104 104 $total = count( $entries ) + 1; // All the headers are one entry. 105 $originals_leng hts_addr = 28;106 $translations_leng hts_addr = $originals_lenghts_addr + 8 * $total;105 $originals_lengths_addr = 28; 106 $translations_lengths_addr = $originals_lengths_addr + 8 * $total; 107 107 $size_of_hash = 0; 108 $hash_addr = $translations_leng hts_addr + 8 * $total;108 $hash_addr = $translations_lengths_addr + 8 * $total; 109 109 $current_addr = $hash_addr; 110 110 fwrite( … … 115 115 $revision, 116 116 $total, 117 $originals_leng hts_addr,118 $translations_leng hts_addr,117 $originals_lengths_addr, 118 $translations_lengths_addr, 119 119 $size_of_hash, 120 120 $hash_addr 121 121 ) 122 122 ); 123 fseek( $fh, $originals_leng hts_addr );123 fseek( $fh, $originals_lengths_addr ); 124 124 125 125 // Headers' msgid is an empty string. … … 230 230 231 231 // Parse header. 232 $header = unpack( "{$endian}revision/{$endian}total/{$endian}originals_leng hts_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 ); 233 233 if ( ! is_array( $header ) ) { 234 234 return false; … … 241 241 242 242 // Seek to data blocks. 243 $reader->seekto( $header['originals_leng hts_addr'] );243 $reader->seekto( $header['originals_lengths_addr'] ); 244 244 245 245 // Read originals' indices. 246 $originals_lengths_length = $header['translations_leng hts_addr'] - $header['originals_lenghts_addr'];246 $originals_lengths_length = $header['translations_lengths_addr'] - $header['originals_lengths_addr']; 247 247 if ( $originals_lengths_length != $header['total'] * 8 ) { 248 248 return false; … … 255 255 256 256 // Read translations' indices. 257 $translations_leng hts_length = $header['hash_addr'] - $header['translations_lenghts_addr'];258 if ( $translations_leng hts_length != $header['total'] * 8 ) {259 return false; 260 } 261 262 $translations = $reader->read( $translations_leng hts_length );263 if ( $reader->strlen( $translations ) != $translations_leng hts_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 ) { 264 264 return false; 265 265 }
Note: See TracChangeset
for help on using the changeset viewer.