diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-02-15 21:49:40 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-02-15 22:11:39 +0100 |
commit | 0c1ec758e89517acac8971f87e3c5796124e40ca (patch) | |
tree | a953116699a6bd23735bb84e8f6d7dfe271d253a /lib/files/mount.php | |
parent | 425d41aaf93e1cd3a44ddc794414683e8e2c4648 (diff) | |
download | nextcloud-server-0c1ec758e89517acac8971f87e3c5796124e40ca.tar.gz nextcloud-server-0c1ec758e89517acac8971f87e3c5796124e40ca.zip |
Cache: hash long storage ids to ensure they fit in the database
Diffstat (limited to 'lib/files/mount.php')
-rw-r--r-- | lib/files/mount.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/files/mount.php b/lib/files/mount.php index 74ee483b1be..6e99d8eabb4 100644 --- a/lib/files/mount.php +++ b/lib/files/mount.php @@ -93,6 +93,9 @@ class Mount { $this->storage = $this->createStorage(); } $this->storageId = $this->storage->getId(); + if (strlen($this->storageId) > 64) { + $this->storageId = md5($this->storageId); + } } return $this->storageId; } @@ -177,6 +180,9 @@ class Mount { * @return \OC\Files\Storage\Storage[] */ public static function findById($id) { + if (strlen($id) > 64) { + $id = md5($id); + } $result = array(); foreach (self::$mounts as $mount) { if ($mount->getStorageId() === $id) { |