]> source.dussan.org Git - nextcloud-server.git/commitdiff
Readd TOKEN_LENGTH
authorkondou <kondou@ts.unde.re>
Thu, 4 Sep 2014 14:46:20 +0000 (16:46 +0200)
committerkondou <kondou@ts.unde.re>
Thu, 4 Sep 2014 17:09:26 +0000 (19:09 +0200)
lib/private/share/constants.php
lib/private/share/share.php

index 1ba4929899a41d061ffb701716908d004935f375..798327cc154d471f58278fe1768e95c9a1e20e89 100644 (file)
@@ -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();
index fe62f4f005e7e337d33ce69a204550a996e22ced..8441e6a94c44a5e7b7007c6db63a5aef1734cff8 100644 (file)
@@ -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
                                        );