chg: [internal] Do not use uniqid() and openssl_random_pseudo_bytes() methods

pull/8327/head
Jakub Onderka 2022-05-15 12:53:08 +02:00
parent 0b0aa0fa1e
commit 781de7dd6a
4 changed files with 6 additions and 7 deletions

View File

@ -114,7 +114,7 @@ class CakeEmailExtended extends CakeEmail
throw new InvalidArgumentException("Expected instance of CakeEmailBody, " . gettype($this->body) . " given.");
}
$this->_boundary = md5(uniqid());
$this->_boundary = md5(mt_rand());
$rendered = [];
if (!empty($this->body->text)) {
@ -191,7 +191,7 @@ class MimeMultipart
public function __construct($subtype = 'mixed', $additionalTypes = array())
{
$this->subtype = $subtype;
$this->boundary = md5(uniqid());
$this->boundary = md5(mt_rand());
$this->additionalTypes = $additionalTypes;
}

View File

@ -5,7 +5,7 @@
* - data_path: The path to the data used to display as the text representation of the link
* - payload_paths: Payloads to encode as form values - key value list with the key being the field name and value being in the typical dot notation extraction path
*/
$randomId = bin2hex(openssl_random_pseudo_bytes(8));
$randomId = dechex(mt_rand());
$fieldsArray = [];
if (!empty($field['payload_paths'])) {
foreach ($field['payload_paths'] as $fieldName => $path) {
@ -54,7 +54,7 @@
);
}
echo sprintf(
'%s<a href="#" onClick="event.preventDefault(); %s">%s</a>',
'%s<a href="#" onclick="event.preventDefault(); %s">%s</a>',
$form,
$onclick,
$text

View File

@ -1,5 +1,5 @@
<?php
$randomId = bin2hex(openssl_random_pseudo_bytes(8));
$randomId = dechex(mt_rand());
echo sprintf(
'<div id="%s" %s>',
empty($scaffold_data['containerId']) ? ('index_container_' . $randomId . '_content') : $scaffold_data['containerId'] . '_content',
@ -10,4 +10,4 @@
if (empty($ajax)) {
echo $this->element('/genericElements/SideMenu/side_menu', $menuData);
}
?>

View File

@ -3,7 +3,6 @@
* create single view child index
*
*/
$randomId = bin2hex(openssl_random_pseudo_bytes(8));
if (!empty($child['url_params'])) {
if (!is_array($child['url_params'])) {
$child['url_params'] = [$child['url_params']];