]> source.dussan.org Git - nextcloud-server.git/commitdiff
fixed if fopen returns false typically on external storage
authorFlorin Peter <github@florin-peter.de>
Tue, 28 May 2013 18:50:14 +0000 (20:50 +0200)
committerFlorin Peter <github@florin-peter.de>
Fri, 31 May 2013 10:23:25 +0000 (12:23 +0200)
apps/files_encryption/lib/util.php

index 0d663549bf6fa9f7ccf186e052c4fd2277cdb113..5335007a68cba0f6204a7d6f5bd474116e851958 100644 (file)
@@ -541,7 +541,7 @@ class Util {
                // we only need 24 byte from the last chunk
                $data = '';
                $handle = $this->view->fopen($path, 'r');
-               if (!fseek($handle, -24, SEEK_END)) {
+               if (is_resource($handle) && !fseek($handle, -24, SEEK_END)) {
                        $data = fgets($handle);
                }