Refrain from reading files of 0 length. Props technosailor. fixes #1999
git-svn-id: https://develop.svn.wordpress.org/trunk@4314 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
9e207e0231
commit
c73dc7e99d
@ -63,8 +63,12 @@ default:
|
||||
if (!$error) {
|
||||
$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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user