mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-05 19:42:38 +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;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$installationVersion = "14.0";
|
$installationVersion = "14.0";
|
||||||
|
|
||||||
|
require_once '../objects/functionSecurity.php';
|
||||||
|
|
||||||
error_log("Installation: ".__LINE__." ". json_encode($_POST));
|
error_log("Installation: ".__LINE__." ". json_encode($_POST));
|
||||||
header('Content-Type: application/json');
|
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;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
require_once $global['systemRootPath'].'objects/functionSecurity.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;
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue