mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
Refrain from reading files of 0 length. Props technosailor. fixes #1999
git-svn-id: http://svn.automattic.com/wordpress/trunk@4314 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7d037d255d
commit
c0c0885c61
@ -63,8 +63,12 @@ default:
|
|||||||
if (!$error) {
|
if (!$error) {
|
||||||
$f = @ fopen($real_file, 'r');
|
$f = @ fopen($real_file, 'r');
|
||||||
if ( $f ) {
|
if ( $f ) {
|
||||||
$content = fread($f, filesize($real_file));
|
if ( filesize($real_file ) > 0 ) {
|
||||||
$content = htmlspecialchars($content);
|
$content = fread($f, filesize($real_file));
|
||||||
|
$content = htmlspecialchars($content);
|
||||||
|
} else {
|
||||||
|
$content = '';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$error = true;
|
$error = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user