OC_Util::generate_random_bytes was camelCased in master
check function existence instead of branching away for stable5
This commit is contained in:
parent
bc2c599663
commit
f34ccef158
@ -135,7 +135,13 @@ class Session extends Db{
|
||||
|
||||
protected static function getUniqueSessionId(){
|
||||
do {
|
||||
$id = \OC_Util::generate_random_bytes(30);
|
||||
// this prevents branching for stable5 for now:
|
||||
// OC_Util::generate_random_bytes was camelCased
|
||||
if (method_exists('\OC_Util', 'generate_random_bytes')) {
|
||||
$id = \OC_Util::generate_random_bytes(30);
|
||||
} else {
|
||||
$id = \OC_Util::generateRandomBytes(30);
|
||||
}
|
||||
} while (self::getSession($id));
|
||||
|
||||
return $id;
|
||||
|
Loading…
x
Reference in New Issue
Block a user