From 01fa314fc57c9e172f54a07320ba5ee5ebbd350c Mon Sep 17 00:00:00 2001 From: Pellaeon Lin Date: Wed, 16 Aug 2017 01:37:48 +0800 Subject: [PATCH] Avoid ISecureRandom::CHAR_HUMAN_READABLE to retain compatibility with ownCloud and Nextcloud < 12.0.0 --- db/registrationmapper.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/db/registrationmapper.php b/db/registrationmapper.php index 0559af9..58f30ec 100644 --- a/db/registrationmapper.php +++ b/db/registrationmapper.php @@ -93,8 +93,9 @@ class RegistrationMapper extends Mapper { * @param Registration $registration */ public function generateClientSecret(Registration &$registration) { - $token = $this->random->generate(32, ISecureRandom::CHAR_HUMAN_READABLE); + $token = $this->random->generate(32, "abcdefgijkmnopqrstwxyzABCDEFGHJKLMNPQRSTWXYZ23456789"); + //FIXME eqivalent to ISecureRandom::CHAR_HUMAN_READABLE introduced in https://github.com/nextcloud/server/commit/f2a2b34e4639e88f8d948a388a51f010212b42a3 but not supported in ownCloud yet. We'll just use the string for now then switch to constants when supported. $registration->setClientSecret($token); } -} \ No newline at end of file +}