From: Michael M Slusarz Date: Wed, 11 Aug 2010 02:25:57 +0000 (-0600) Subject: Tweaks to new randomid algorithm X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=01bd22e29c9b427915e7c9076f82c916c376cd04;p=horde.git Tweaks to new randomid algorithm --- diff --git a/framework/Support/lib/Horde/Support/Randomid.php b/framework/Support/lib/Horde/Support/Randomid.php index 150effcfe..4ca64929a 100644 --- a/framework/Support/lib/Horde/Support/Randomid.php +++ b/framework/Support/lib/Horde/Support/Randomid.php @@ -46,7 +46,9 @@ class Horde_Support_Randomid */ public function generate() { - $this->_rid = rtrim(base64_encode(pack('H*', strtr(uniqid(mt_rand(), true), array('.' => '')) . dechex(getmypid()))), '='); + /* Base64 can have /, +, and = characters. Restrict to just + * numbers and letters. */ + $this->_rid = str_replace(array('/', '+', '='), 0, base64_encode(pack('H*', mt_rand() . strtr(uniqid('', true), '.', '') . dechex(getmypid())))); } /**