diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/app/appmanager.php | 7 | ||||
-rw-r--r-- | lib/private/files/storage/dav.php | 22 | ||||
-rw-r--r-- | lib/public/imemcachettl.php | 4 |
3 files changed, 23 insertions, 10 deletions
diff --git a/lib/private/app/appmanager.php b/lib/private/app/appmanager.php index f826c8ba0c7..8ae93f98832 100644 --- a/lib/private/app/appmanager.php +++ b/lib/private/app/appmanager.php @@ -148,6 +148,13 @@ class AppManager implements IAppManager { return false; } else { $groupIds = json_decode($enabled); + + if (!is_array($groupIds)) { + $jsonError = json_last_error(); + \OC::$server->getLogger()->warning('AppManger::checkAppForUser - can\'t decode group IDs: ' . print_r($enabled, true) . ' - json error code: ' . $jsonError, ['app' => 'lib']); + return false; + } + $userGroups = $this->groupManager->getUserGroupIds($user); foreach ($userGroups as $groupId) { if (array_search($groupId, $groupIds) !== false) { diff --git a/lib/private/files/storage/dav.php b/lib/private/files/storage/dav.php index dda163e41a0..9afebab1dd7 100644 --- a/lib/private/files/storage/dav.php +++ b/lib/private/files/storage/dav.php @@ -34,6 +34,7 @@ namespace OC\Files\Storage; use Exception; +use GuzzleHttp\Exception\RequestException; use OC\Files\Filesystem; use OC\Files\Stream\Close; use Icewind\Streams\IteratorDirectory; @@ -339,15 +340,20 @@ class DAV extends Common { switch ($mode) { case 'r': case 'rb': - if (!$this->file_exists($path)) { - return false; + try { + $response = $this->httpClientService + ->newClient() + ->get($this->createBaseUri() . $this->encodePath($path), [ + 'auth' => [$this->user, $this->password], + 'stream' => true + ]); + } catch (RequestException $e) { + if ($e->getResponse()->getStatusCode() === 404) { + return false; + } else { + throw $e; + } } - $response = $this->httpClientService - ->newClient() - ->get($this->createBaseUri() . $this->encodePath($path), [ - 'auth' => [$this->user, $this->password], - 'stream' => true - ]); if ($response->getStatusCode() !== Http::STATUS_OK) { if ($response->getStatusCode() === Http::STATUS_LOCKED) { diff --git a/lib/public/imemcachettl.php b/lib/public/imemcachettl.php index a4a7a530549..3c2bfe8ad27 100644 --- a/lib/public/imemcachettl.php +++ b/lib/public/imemcachettl.php @@ -24,7 +24,7 @@ namespace OCP; /** * Interface for memcache backends that support setting ttl after the value is set * - * @since 9.0.0 + * @since 8.2.2 */ interface IMemcacheTTL extends IMemcache { /** @@ -32,7 +32,7 @@ interface IMemcacheTTL extends IMemcache { * * @param string $key * @param int $ttl time to live in seconds - * @since 9.0.0 + * @since 8.2.2 */ public function setTTL($key, $ttl); } |