summaryrefslogtreecommitdiffstats
path: root/application/helpers
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2013-09-04 23:39:14 +0200
committerFlorian Pritz <bluewind@xinu.at>2013-09-04 23:39:14 +0200
commit26a4f99c3b579320a4bb321ac11eb891a194b44c (patch)
treec1dca8a7d1f2879acfcf8214e4b2f15dd1669bf8 /application/helpers
parent03a2f396ab9bc58c66cd79adce177e964d51a1e2 (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')
-rw-r--r--application/helpers/filebin_helper.php2
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;
}