summaryrefslogtreecommitdiff
path: root/includes/stream_wrappers.inc
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-12-30 22:33:04 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-12-30 22:33:04 +0000
commit540ce2b461ee6cef5ff0c7b6dd9d768b1338c229 (patch)
tree27b196e6e094119b01a015685162f5af1b034368 /includes/stream_wrappers.inc
parentf6cd923ed7099e50bcbb0006d38c3b4a39215cb7 (diff)
downloadbrdo-540ce2b461ee6cef5ff0c7b6dd9d768b1338c229.tar.gz
brdo-540ce2b461ee6cef5ff0c7b6dd9d768b1338c229.tar.bz2
#1006302 by aspilicious, bfroehle: Fixed can't install projects packed as zip in Update Manager.
Diffstat (limited to 'includes/stream_wrappers.inc')
-rw-r--r--includes/stream_wrappers.inc9
1 files changed, 6 insertions, 3 deletions
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);
}
}