summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkondou <kondou@ts.unde.re>2014-09-04 16:46:20 +0200
committerkondou <kondou@ts.unde.re>2014-09-04 19:09:26 +0200
commita10411d2bc3f98b8a0f2fa99563328ccf4605d0b (patch)
tree5279084521779817ba4640ea06ab19a31dcd192a
parent226b203e206b534aa3d547ed0c81eb8f9c344cbc (diff)
downloadnextcloud-server-a10411d2bc3f98b8a0f2fa99563328ccf4605d0b.tar.gz
nextcloud-server-a10411d2bc3f98b8a0f2fa99563328ccf4605d0b.zip
Readd TOKEN_LENGTH
-rw-r--r--lib/private/share/constants.php2
-rw-r--r--lib/private/share/share.php2
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/private/share/constants.php b/lib/private/share/constants.php
index 1ba4929899a..798327cc154 100644
--- a/lib/private/share/constants.php
+++ b/lib/private/share/constants.php
@@ -34,6 +34,8 @@ class Constants {
const FORMAT_STATUSES = -2;
const FORMAT_SOURCES = -3; // ToDo Check if it is still in use otherwise remove it
+ const TOKEN_LENGTH = 15; // old (oc7) length is 32, keep token length in db at least that for compatibility
+
protected static $shareTypeUserAndGroups = -1;
protected static $shareTypeGroupUserUnique = 2;
protected static $backends = array();
diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index fe62f4f005e..8441e6a94c4 100644
--- a/lib/private/share/share.php
+++ b/lib/private/share/share.php
@@ -640,7 +640,7 @@ class Share extends \OC\Share\Constants {
if (isset($oldToken)) {
$token = $oldToken;
} else {
- $token = \OC::$server->getSecureRandom()->getMediumStrengthGenerator()->generate($tokenLength,
+ $token = \OC::$server->getSecureRandom()->getMediumStrengthGenerator()->generate(self::TOKEN_LENGTH,
\OCP\Security\ISecureRandom::CHAR_LOWER.\OCP\Security\ISecureRandom::CHAR_UPPER.
\OCP\Security\ISecureRandom::CHAR_DIGITS
);