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:
parent
c2547c9aa1
commit
5792b83c42
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user