diff options
author | Florian Pritz <bluewind@xinu.at> | 2013-09-04 23:39:14 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2013-09-04 23:39:14 +0200 |
commit | 26a4f99c3b579320a4bb321ac11eb891a194b44c (patch) | |
tree | c1dca8a7d1f2879acfcf8214e4b2f15dd1669bf8 /application/helpers/filebin_helper.php | |
parent | 03a2f396ab9bc58c66cd79adce177e964d51a1e2 (diff) |
Fix off-by-one error in random_alphanum()
This could result in too short strings
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/helpers/filebin_helper.php')
-rw-r--r-- | application/helpers/filebin_helper.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/application/helpers/filebin_helper.php b/application/helpers/filebin_helper.php index 53fc4f280..bed696c8c 100644 --- a/application/helpers/filebin_helper.php +++ b/application/helpers/filebin_helper.php @@ -218,7 +218,7 @@ function random_alphanum($min_length, $max_length = null) for($i = 0; $i < $max_length; $i++) { if (strlen($random) == $length) break; - $random .= substr($char_list, mt_rand(0, strlen($char_list)), 1); + $random .= substr($char_list, mt_rand(0, strlen($char_list) - 1), 1); } return $random; } |