mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Check if our version of roll data is valid and if necessary, initialize
the database. This fix the case where the database is not initialized because the used field in backup file is empty. Fix the issue #5113.
This commit is contained in:
parent
32cf6a0c1c
commit
ce274e4545
@ -557,6 +557,9 @@ function voucher_configure_zone($sync = false) {
|
||||
foreach ($config['voucher'][$cpzone]['roll'] as $rollent) {
|
||||
|
||||
$roll = $rollent['number'];
|
||||
$len = ($rollent['count'] >> 3) + 1;
|
||||
if (strlen(base64_decode($rollent['used'])) != $len)
|
||||
$rollent['used'] = base64_encode(str_repeat("\000", $len));
|
||||
voucher_write_used_db($roll, $rollent['used']);
|
||||
$minutes = $rollent['minutes'];
|
||||
$active_vouchers = array();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user