diff options
| author | Andreas Fischer <bantu@phpbb.com> | 2010-05-17 09:40:32 +0200 |
|---|---|---|
| committer | Andreas Fischer <bantu@phpbb.com> | 2010-05-17 09:44:48 +0200 |
| commit | c2b29c317f2d3bf41ed737c9eb3d49bce41ec432 (patch) | |
| tree | a8c43d327787c7cd3e3480c08ee4bfe0b8f9712b /phpBB/includes/captcha/plugins/captcha_abstract.php | |
| parent | af21e38c1d6f3fd738c97bd6cf0f96285c0b35aa (diff) | |
| download | forums-c2b29c317f2d3bf41ed737c9eb3d49bce41ec432.tar forums-c2b29c317f2d3bf41ed737c9eb3d49bce41ec432.tar.gz forums-c2b29c317f2d3bf41ed737c9eb3d49bce41ec432.tar.bz2 forums-c2b29c317f2d3bf41ed737c9eb3d49bce41ec432.tar.xz forums-c2b29c317f2d3bf41ed737c9eb3d49bce41ec432.zip | |
[ticket/9612] Introduce new function gen_rand_string_friendly().
Introduce new function gen_rand_string_friendly() for user friendly random
strings like passwords and captcha codes. Strings generated by
gen_rand_string_friendly() will not contain the characters 0 and O.
By adding a new function we can increase the entropy of strings
generated by gen_rand_string() by putting 0 and O back in.
PHPBB3-9612
Diffstat (limited to 'phpBB/includes/captcha/plugins/captcha_abstract.php')
| -rw-r--r-- | phpBB/includes/captcha/plugins/captcha_abstract.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/phpBB/includes/captcha/plugins/captcha_abstract.php b/phpBB/includes/captcha/plugins/captcha_abstract.php index e7b8742b05..21cacd730c 100644 --- a/phpBB/includes/captcha/plugins/captcha_abstract.php +++ b/phpBB/includes/captcha/plugins/captcha_abstract.php @@ -59,7 +59,7 @@ class phpbb_default_captcha { global $user; - $this->code = gen_rand_string(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS)); + $this->code = gen_rand_string_friendly(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS)); $this->seed = hexdec(substr(unique_id(), 4, 10)); // compute $seed % 0x7fffffff @@ -235,7 +235,7 @@ class phpbb_default_captcha { global $db, $user; - $this->code = gen_rand_string(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS)); + $this->code = gen_rand_string_friendly(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS)); $this->confirm_id = md5(unique_id($user->ip)); $this->seed = hexdec(substr(unique_id(), 4, 10)); $this->solved = 0; @@ -259,7 +259,7 @@ class phpbb_default_captcha { global $db, $user; - $this->code = gen_rand_string(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS)); + $this->code = gen_rand_string_friendly(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS)); $this->seed = hexdec(substr(unique_id(), 4, 10)); $this->solved = 0; // compute $seed % 0x7fffffff @@ -281,7 +281,7 @@ class phpbb_default_captcha { global $db, $user; - $this->code = gen_rand_string(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS)); + $this->code = gen_rand_string_friendly(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS)); $this->seed = hexdec(substr(unique_id(), 4, 10)); $this->solved = 0; // compute $seed % 0x7fffffff |
