From 52dccd4aa14612ed93f50967e85ed6a0c6e22295 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 26 Feb 2013 02:53:02 +0100 Subject: [PATCH] Storage: don't throw warnings when a stat fails --- lib/files/storage/common.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/files/storage/common.php b/lib/files/storage/common.php index 0e59656192..cb41d17e44 100644 --- a/lib/files/storage/common.php +++ b/lib/files/storage/common.php @@ -38,7 +38,11 @@ abstract class Common implements \OC\Files\Storage\Storage { return 0; //by definition } else { $stat = $this->stat($path); - return $stat['size']; + if (isset($stat['size'])) { + return $stat['size']; + } else { + return 0; + } } } @@ -79,7 +83,11 @@ abstract class Common implements \OC\Files\Storage\Storage { public function filemtime($path) { $stat = $this->stat($path); - return $stat['mtime']; + if (isset($stat['mtime'])) { + return $stat['mtime']; + } else { + return 0; + } } public function file_get_contents($path) {