2
0
forked from Wavyzz/dolibarr

replace random_bytes

This commit is contained in:
Frédéric FRANCE
2018-11-15 21:17:59 +01:00
parent 482c6efdd9
commit 7c241620c0
3 changed files with 21 additions and 5 deletions

View File

@@ -92,7 +92,7 @@ class Swift_Mime_SimpleMimeEntity implements Swift_Mime_CharsetObserver, Swift_M
*/
public function __construct(Swift_Mime_SimpleHeaderSet $headers, Swift_Mime_ContentEncoder $encoder, Swift_KeyCache $cache, Swift_IdGenerator $idGenerator)
{
$this->cacheKey = bin2hex(random_bytes(16)); // set 32 hex values
$this->cacheKey = md5(getmypid().'.'.time().'.'.uniqid(mt_rand(), true));
$this->cache = $cache;
$this->headers = $headers;
$this->idGenerator = $idGenerator;
@@ -420,7 +420,7 @@ class Swift_Mime_SimpleMimeEntity implements Swift_Mime_CharsetObserver, Swift_M
public function getBoundary()
{
if (!isset($this->boundary)) {
$this->boundary = '_=_swift_'.time().'_'.bin2hex(random_bytes(16)).'_=_';
$this->boundary = '_=_swift_'.time().'_'.md5(getmypid().'.'.time().'.'.uniqid(mt_rand(), true)).'_=_';
}
return $this->boundary;
@@ -813,7 +813,7 @@ class Swift_Mime_SimpleMimeEntity implements Swift_Mime_CharsetObserver, Swift_M
{
$this->headers = clone $this->headers;
$this->encoder = clone $this->encoder;
$this->cacheKey = bin2hex(random_bytes(16)); // set 32 hex values
$this->cacheKey = md5(getmypid().'.'.time().'.'.uniqid(mt_rand(), true));
$children = array();
foreach ($this->children as $pos => $child) {
$children[$pos] = clone $child;