Merge pull request #48446 from nextcloud/fix/fix-storage-interface-check

pull/48453/head
Kate 2024-09-30 11:58:40 +07:00 committed by GitHub
commit c7895bc3cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

@ -64,7 +64,7 @@ class ConfigAdapter implements IMountProvider {
*/
private function constructStorage(StorageConfig $storageConfig): IStorage {
$class = $storageConfig->getBackend()->getStorageClass();
if (!$class instanceof IConstructableStorage) {
if (!is_a($class, IConstructableStorage::class, true)) {
\OCP\Server::get(LoggerInterface::class)->warning('Building a storage not implementing IConstructableStorage is deprecated since 31.0.0', ['class' => $class]);
}
$storage = new $class($storageConfig->getBackendOptions());

@ -52,7 +52,7 @@ class StorageFactory implements IStorageFactory {
* @return IStorage
*/
public function getInstance(IMountPoint $mountPoint, $class, $arguments): IStorage {
if (!($class instanceof IConstructableStorage)) {
if (!is_a($class, IConstructableStorage::class, true)) {
\OCP\Server::get(LoggerInterface::class)->warning('Building a storage not implementing IConstructableStorage is deprecated since 31.0.0', ['class' => $class]);
}
return $this->wrap($mountPoint, new $class($arguments));