diff options
author | Marc Alexander <admin@m-a-styles.de> | 2016-02-18 21:52:48 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2016-02-18 21:52:48 +0100 |
commit | f6fd819764016afe39dcc3c486b0fe73c9478ad5 (patch) | |
tree | 43828d9b0761cf8144c59f032891249c7b79ac68 /phpBB/includes/functions.php | |
parent | 028191e7c2360b3bf0d3ed4b70cbf70364e3b230 (diff) | |
parent | 58359b158716d6dc752c6a50b05b8dea7d5dfff4 (diff) | |
download | forums-f6fd819764016afe39dcc3c486b0fe73c9478ad5.tar forums-f6fd819764016afe39dcc3c486b0fe73c9478ad5.tar.gz forums-f6fd819764016afe39dcc3c486b0fe73c9478ad5.tar.bz2 forums-f6fd819764016afe39dcc3c486b0fe73c9478ad5.tar.xz forums-f6fd819764016afe39dcc3c486b0fe73c9478ad5.zip |
Merge pull request #4165 from Nicofuma/ticket/14457
[ticket/14457] Uses a random placeholder to inject css and js
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r-- | phpBB/includes/functions.php | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 54ff51dda5..5125a601d6 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -93,25 +93,10 @@ function gen_rand_string_friendly($num_chars = 8) /** * Return unique id -* @param string $extra additional entropy */ -function unique_id($extra = 'c') +function unique_id() { - static $dss_seeded = false; - global $config; - - $val = $config['rand_seed'] . microtime(); - $val = md5($val); - $config['rand_seed'] = md5($config['rand_seed'] . $val . $extra); - - if ($dss_seeded !== true && ($config['rand_seed_last_update'] < time() - rand(1,10))) - { - $config->set('rand_seed_last_update', time(), false); - $config->set('rand_seed', $config['rand_seed'], false); - $dss_seeded = true; - } - - return substr($val, 4, 16); + return bin2hex(random_bytes(6)); } /** |