mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-27 18:16:08 +00:00
Refrain from reading files of 0 length. Props technosailor. fixes #1999
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4315 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6d48598e84
commit
6b08dcf49f
@ -71,14 +71,17 @@ default:
|
|||||||
|
|
||||||
update_recently_edited($file);
|
update_recently_edited($file);
|
||||||
|
|
||||||
if (!is_file($real_file))
|
if ( !is_file($real_file) ) {
|
||||||
$error = true;
|
$error = true;
|
||||||
|
} else {
|
||||||
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…
x
Reference in New Issue
Block a user