Skip to content

Commit 82b23ad

Browse files
authored
0.0.17 (#24)
* Add compatibility note to changelog * updated tested until to 6.8.1
1 parent cdcac5d commit 82b23ad

File tree

4 files changed

+23
-6
lines changed

4 files changed

+23
-6
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ Please report security bugs found in the source code of the bdvs-password-reset
4848
[Report a security vulnerability.](https://patchstack.com/database/vdp/bdvs-password-reset)
4949

5050
## Change Log
51+
- 0.0.17
52+
- switched to a cryptographically secure function to generate reset codes
53+
- updated compatibility to 6.8.1
5154
- 0.0.16
5255
- updated compatibility to 6.3
5356
- By default users with the administrator role are no longer able to reset their password using this plugin

bdvs-password-reset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Plugin Name: REST API Password Reset with Code
77
* Plugin URI: https://www.bedevious.co.uk/
88
* Description: Allow users to reset their password using a random 4 digit code via the REST API
9-
* Version: 0.0.16
9+
* Version: 0.0.17
1010
* Author: Be Devious Web Development
1111
* Author URI: https://www.bedevious.co.uk/
1212
* License: GNU GPLv3

inc/functions.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function bdpwr_generate_4_digit_code() {
1818
*/
1919

2020
$length = apply_filters( 'bdpwr_code_length', 8 );
21-
$selection_string = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!£$%^&*()_+-={}[]@~\#<>?/|\\';
21+
$selection_string = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!£$%^&*()_+-={}[]@~\#<>?/|\\';
2222

2323
/**
2424
*
@@ -27,9 +27,16 @@ function bdpwr_generate_4_digit_code() {
2727
* @param $string str the string to select a code from
2828
*/
2929

30-
$selection_string = apply_filters( 'bdpwr_selection_string', $selection_string );
30+
$selection_string = apply_filters( 'bdpwr_selection_string', $selection_string );
3131

32-
return substr( str_shuffle( $selection_string ), 0, $length );
32+
$max_index = strlen( $selection_string ) - 1;
33+
$code = '';
34+
for ( $i = 0; $i < $length; $i++ ) {
35+
$index = random_int( 0, $max_index );
36+
$code .= $selection_string[ $index ];
37+
}
38+
39+
return $code;
3340
}
3441

3542

readme.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
Contributors: dominic_ks, wpamitkumar
44
Tags: wp-api, password reset
55
Requires at least: 4.6
6-
Tested up to: 6.3
6+
Tested up to: 6.8.1
77
Requires PHP: 5.4
8-
Stable tag: 0.0.16
8+
Stable tag: 0.0.17
99
License: GNU GPLv3
1010
License URI: https://www.gnu.org/licenses/gpl-3.0
1111

@@ -266,6 +266,9 @@ Please report security bugs found in the source code of the bdvs-password-reset
266266

267267
== Upgrade Notice ==
268268

269+
= 0.0.17 =
270+
* switched to a cryptographically secure function to generate reset codes
271+
* updated compatibility to 6.8.1
269272
= 0.0.16 =
270273
* updated compatibility to 6.3
271274
* By default users with the administrator role are no longer able to reset their password using this plugin
@@ -276,6 +279,10 @@ Please report security bugs found in the source code of the bdvs-password-reset
276279
Security enhancements
277280

278281
== Changelog ==
282+
= 0.0.17 =
283+
* switched to a cryptographically secure function to generate reset codes
284+
* updated compatibility to 6.5
285+
279286
= 0.0.16 =
280287
* updated compatibility to 6.3
281288
* By default users with the administrator role are no longer able to reset their password using this plugin

0 commit comments

Comments
 (0)