Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Ensure the user exists before calling a method on it - fixes #24751
  • Loading branch information
DeepDiver1975 authored and rullzer committed Aug 17, 2016
commit 63fc5b601d9aa0ba434e35970901887dff07861c
10 changes: 7 additions & 3 deletions lib/private/legacy/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ public static function setupFS($user = '') {

// install storage availability wrapper, before most other wrappers
\OC\Files\Filesystem::addStorageWrapper('oc_availability', function ($mountPoint, $storage) {
/** @var \OCP\Files\Storage $storage */
if (!$storage->instanceOfStorage('\OC\Files\Storage\Shared') && !$storage->isLocal()) {
return new \OC\Files\Storage\Wrapper\Availability(['storage' => $storage]);
}
Expand Down Expand Up @@ -294,12 +295,15 @@ public static function isDefaultExpireDateEnforced() {
* @return int Quota bytes
*/
public static function getUserQuota($user) {
$userQuota = \OC::$server->getUserManager()->get($user)->getQuota();
$user = \OC::$server->getUserManager()->get($user);
if (is_null($user)) {
return \OCP\Files\FileInfo::SPACE_UNLIMITED;
}
$userQuota = $user->getQuota();
if($userQuota === 'none') {
return \OCP\Files\FileInfo::SPACE_UNLIMITED;
}else{
return OC_Helper::computerFileSize($userQuota);
}
return OC_Helper::computerFileSize($userQuota);
}

/**
Expand Down