mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-06 02:41:27 +01: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);
|
||||
|
||||
if (!is_file($real_file))
|
||||
if ( !is_file($real_file) ) {
|
||||
$error = true;
|
||||
|
||||
if (!$error) {
|
||||
} else {
|
||||
$f = @ fopen($real_file, 'r');
|
||||
if ( $f ) {
|
||||
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