diff --git a/etc/inc/voucher.inc b/etc/inc/voucher.inc index 863cc171e5..b3de23c57b 100644 --- a/etc/inc/voucher.inc +++ b/etc/inc/voucher.inc @@ -249,8 +249,10 @@ function voucher_expire($voucher_received) { // Roll# and Ticket# using the external readvoucher binary foreach ($a_vouchers_received as $voucher) { $v = escapeshellarg($voucher); - if (strlen($voucher) < 3) + if (strlen($voucher) < 5) { + captiveportal_syslog("{$voucher} invalid: Too short!"); continue; // seems too short to be a voucher! + } unset($output); $_gb = exec("/usr/local/bin/voucher -c {$g['varetc_path']}/voucher_{$cpzone}.cfg -k {$g['varetc_path']}/voucher_{$cpzone}.public -- $v", $output); @@ -371,7 +373,7 @@ function voucher_auth($voucher_received, $test = 0) { // Roll# and Ticket# using the external readvoucher binary foreach ($a_vouchers_received as $voucher) { $v = escapeshellarg($voucher); - if (strlen($voucher) < 3) { + if (strlen($voucher) < 5) { $test_result[] = "{$voucher} invalid: Too short!"; captiveportal_syslog("{$voucher} invalid: Too short!"); $error++;