From 540ce2b461ee6cef5ff0c7b6dd9d768b1338c229 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Thu, 30 Dec 2010 22:33:04 +0000 Subject: #1006302 by aspilicious, bfroehle: Fixed can't install projects packed as zip in Update Manager. --- includes/stream_wrappers.inc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'includes') diff --git a/includes/stream_wrappers.inc b/includes/stream_wrappers.inc index 23faf4fc9..1f837783d 100644 --- a/includes/stream_wrappers.inc +++ b/includes/stream_wrappers.inc @@ -671,11 +671,14 @@ abstract class DrupalLocalStreamWrapper implements DrupalStreamWrapperInterface */ public function url_stat($uri, $flags) { $this->uri = $uri; - if ($flags & STREAM_URL_STAT_QUIET) { - return @stat($this->getLocalPath()); + $path = $this->getLocalPath(); + // Suppress warnings if requested or if the file or directory does not + // exist. This is consistent with PHP's plain filesystem stream wrapper. + if ($flags & STREAM_URL_STAT_QUIET || !file_exists($path)) { + return @stat($path); } else { - return stat($this->getLocalPath()); + return stat($path); } } -- cgit v1.2.3