mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
This commit is contained in:
parent
f953799b4b
commit
93fd34cd82
3 changed files with 24 additions and 18 deletions
|
@ -4,8 +4,11 @@ if (file_exists("../videos/configuration.php")) {
|
|||
exit;
|
||||
}
|
||||
|
||||
|
||||
$installationVersion = "14.0";
|
||||
|
||||
require_once '../objects/functionSecurity.php';
|
||||
|
||||
error_log("Installation: ".__LINE__." ". json_encode($_POST));
|
||||
header('Content-Type: application/json');
|
||||
|
||||
|
|
20
objects/functionSecurity.php
Normal file
20
objects/functionSecurity.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
/*
|
||||
secure salt in PHP using standard characters and numbers.
|
||||
This code will generate a 10 to 32-character string
|
||||
*/
|
||||
function _uniqid() {
|
||||
// Generate 16 bytes of random data
|
||||
$randomBytes = random_bytes(16);
|
||||
|
||||
// Convert the binary data to a hexadecimal string
|
||||
$hex = bin2hex($randomBytes);
|
||||
|
||||
// If you want a variable length output, you can truncate the MD5 hash
|
||||
// For example, to get a random length between 10 and 32 characters:
|
||||
$randomLength = rand(10, 32);
|
||||
$randomString = substr($hex, 0, $randomLength);
|
||||
|
||||
return $randomString;
|
||||
}
|
||||
?>
|
|
@ -11985,21 +11985,4 @@ function getValueOrBlank($array, $default=''){
|
|||
return $text;
|
||||
}
|
||||
|
||||
/*
|
||||
secure salt in PHP using standard characters and numbers.
|
||||
This code will generate a 10 to 32-character string
|
||||
*/
|
||||
function _uniqid() {
|
||||
// Generate 16 bytes of random data
|
||||
$randomBytes = random_bytes(16);
|
||||
|
||||
// Convert the binary data to a hexadecimal string
|
||||
$hex = bin2hex($randomBytes);
|
||||
|
||||
// If you want a variable length output, you can truncate the MD5 hash
|
||||
// For example, to get a random length between 10 and 32 characters:
|
||||
$randomLength = rand(10, 32);
|
||||
$randomString = substr($hex, 0, $randomLength);
|
||||
|
||||
return $randomString;
|
||||
}
|
||||
require_once $global['systemRootPath'].'objects/functionSecurity.php';
|
Loading…
Add table
Add a link
Reference in a new issue