WordPress.org

Make WordPress Core

Ticket #14207: 14207.2.patch

File 14207.2.patch, 891 bytes (added by SergeyBiryukov, 2 years ago)
  • wp-includes/pomo/mo.php

     
    154154 
    155155                // read originals' indices 
    156156                $originals_lengths_length = $translations_lenghts_addr - $originals_lenghts_addr; 
    157                 if ( $originals_lengths_length != $total * 8 ) 
     157                if ( !$originals_lengths_length || $originals_lengths_length != $total * 8 ) 
    158158                        return false; 
    159159 
    160160                $originals = $reader->read($originals_lengths_length); 
     
    163163 
    164164                // read translations' indices 
    165165                $translations_lenghts_length = $hash_addr - $translations_lenghts_addr; 
    166                 if ( $translations_lenghts_length != $total * 8 ) 
     166                if ( !$translations_lenghts_length || $translations_lenghts_length != $total * 8 ) 
    167167                        return false; 
    168168 
    169169                $translations = $reader->read($translations_lenghts_length);