diff --git a/wp-admin/templates.php b/wp-admin/templates.php index 4631ac42dc..270000d73b 100644 --- a/wp-admin/templates.php +++ b/wp-admin/templates.php @@ -71,14 +71,17 @@ default: update_recently_edited($file); - if (!is_file($real_file)) + if ( !is_file($real_file) ) { $error = true; - - if (!$error) { + } else { $f = @ fopen($real_file, 'r'); if ( $f ) { - $content = fread($f, filesize($real_file)); - $content = htmlspecialchars($content); + if ( filesize($real_file ) > 0 ) { + $content = fread($f, filesize($real_file)); + $content = htmlspecialchars($content); + } else { + $content = ''; + } } else { $error = true; }