From 3417e0245a6102387c3ecc3a915dbf6ed275eb04 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Tue, 30 Oct 2012 20:48:35 +0000 Subject: [PATCH] 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: http://core.svn.wordpress.org/trunk@22330 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-feed.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/class-feed.php b/wp-includes/class-feed.php index 126255eb28..14eabb3b83 100644 --- a/wp-includes/class-feed.php +++ b/wp-includes/class-feed.php @@ -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; }