WordPress.org

Make WordPress Core

Changeset 4314


Ignore:
Timestamp:
10/04/2006 07:29:33 AM (12 years ago)
Author:
markjaquith
Message:

Refrain from reading files of 0 length. Props technosailor. fixes #1999

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/templates.php

    r3985 r4314  
    6464        $f = @ fopen($real_file, 'r');
    6565        if ( $f ) {
    66             $content = fread($f, filesize($real_file));
    67             $content = htmlspecialchars($content);
     66            if ( filesize($real_file ) > 0 ) {
     67                $content = fread($f, filesize($real_file));
     68                $content = htmlspecialchars($content);
     69            } else {
     70                $content = '';
     71            }
    6872        } else {
    6973            $error = true;
Note: See TracChangeset for help on using the changeset viewer.