When reading local feeds from disk, check that the file exists first to avoid a PHP Warning in WP_SimplePie_File. Props SergeyBiryukov. Fixes #17756

git-svn-id: https://develop.svn.wordpress.org/trunk@22330 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2012-10-30 20:48:35 +00:00
parent c2547c9aa1
commit 5792b83c42

View File

@ -89,7 +89,7 @@ class WP_SimplePie_File extends SimplePie_File {
$this->status_code = wp_remote_retrieve_response_code( $res );
}
} else {
if ( ! $this->body = file_get_contents($url) ) {
if ( ! file_exists($url) || ( ! $this->body = file_get_contents($url) ) ) {
$this->error = 'file_get_contents could not read the file';
$this->success = false;
}