mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-25 00:50:29 +00:00
Validate channel w/ RASPI_5GHZ_MAX_CHANNEL, addresses #450
This commit is contained in:
parent
8686406ef1
commit
b095073043
1 changed files with 7 additions and 7 deletions
|
@ -118,19 +118,19 @@ function SaveHostAPDConfig($wpa_array, $enc_types, $modes, $interfaces, $status)
|
|||
error_log("Attempting to set hostapd config with wpa='".$_POST['wpa']."', wpa_pairwise='".$_POST['wpa_pairwise']."' and hw_mode='".$_POST['hw_mode']."'"); // FIXME: log injection
|
||||
return false;
|
||||
}
|
||||
// Validate input
|
||||
$good_input = true;
|
||||
|
||||
if (!filter_var($_POST['channel'], FILTER_VALIDATE_INT)) {
|
||||
error_log("Attempting to set channel to invalid number.");
|
||||
return false;
|
||||
$status->addMessage('Attempting to set channel to invalid number.', 'danger');
|
||||
$good_input = false;
|
||||
}
|
||||
|
||||
if (intval($_POST['channel']) < 1 || intval($_POST['channel']) > 48) {
|
||||
error_log("Attempting to set channel to '".$_POST['channel']."'");
|
||||
return false;
|
||||
if (intval($_POST['channel']) < 1 || intval($_POST['channel']) > RASPI_5GHZ_MAX_CHANNEL) {
|
||||
$status->addMessage('Attempting to set channel outside of permitted range', 'danger');
|
||||
$good_input = false;
|
||||
}
|
||||
|
||||
$good_input = true;
|
||||
|
||||
// Check for Bridged AP mode checkbox
|
||||
$bridgedEnable = 0;
|
||||
if ($arrHostapdConf['BridgedEnable'] == 0) {
|
||||
|
|
Loading…
Reference in a new issue