public function getOb($cacheid = null)
{
if (empty($cacheid)) {
- $cacheid = uniqid(mt_rand());
+ $cacheid = strval(new Horde_Support_Randomid());
} elseif (!isset($this->_instances[$cacheid])) {
$obs = $GLOBALS['injector']->getInstance('Horde_SessionObjects');
$this->_instances[$cacheid] = $obs->query($cacheid);
} catch (Horde_Imap_Client_Exception $e) {}
}
- /* This should generate a sufficiently random #. */
- return time() . mt_rand();
+ return strval(new Horde_Support_Randomid());
}
/* Countable methods. */
/* Catch case where using mimp on a javascript browser. */
if ($_SESSION['imp']['view'] != 'mimp') {
- $uid = 'htmldata_' . uniqid(mt_rand());
+ $uid = strval(new Horde_Support_Randomid());
Horde::addScriptFile('imp.js', 'imp');
'img' => ($inline && $GLOBALS['prefs']->getValue('html_image_replacement') && !$this->_inAddressBook()),
'imgblock' => false,
'inline' => $inline,
- 'target' => 'target_' . uniqid(mt_rand())
+ 'target' => strval(new Horde_Support_Randomid())
);
/* Image filtering. */
public function createSearchQuery($query, $folders, $criteria, $label,
$id = null)
{
- $id = is_null($id) ? uniqid(mt_rand()) : $this->_strip($id);
+ $id = is_null($id)
+ ? strval(new Horde_Support_Randomid())
+ : $this->_strip($id);
$_SESSION['imp']['search'][$id] = array(
'c' => $criteria,