Use instanceOfStorage instead of instanceof

remotes/origin/stable6
Robin Appelman 12 years ago
parent 79b953a920
commit b3c8b574df
  1. 8
      lib/private/files.php
  2. 5
      lib/private/util.php

@ -131,10 +131,10 @@ class OC_Files {
}
if ($xsendfile) {
list($storage) = \OC\Files\Filesystem::resolvePath(\OC\Files\Filesystem::getView()->getAbsolutePath($filename));
if ($storage instanceof \OC\Files\Storage\Wrapper\Wrapper) {
$storage = $storage->getWrapperStorage();
}
if ($storage instanceof \OC\Files\Storage\Local) {
/**
* @var \OC\Files\Storage\Storage $storage
*/
if ($storage->instanceOfStorage('\OC\Files\Storage\Local')) {
self::addSendfileHeader(\OC\Files\Filesystem::getLocalFile($filename));
}
}

@ -61,7 +61,10 @@ class OC_Util {
// set up quota for home storages, even for other users
// which can happen when using sharing
if ($storage instanceof \OC\Files\Storage\Home) {
/**
* @var \OC\Files\Storage\Storage $storage
*/
if ($storage->instanceOfStorage('\OC\Files\Storage\Home')) {
$user = $storage->getUser()->getUID();
$quota = OC_Util::getUserQuota($user);
if ($quota !== \OC\Files\SPACE_UNLIMITED) {

Loading…
Cancel
Save