mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
Validate channel w/ RASPI_5GHZ_MAX_CHANNEL, addresses #450
This commit is contained in:
parent
8686406ef1
commit
b095073043
@ -118,18 +118,18 @@ 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
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
// Validate input
|
||||||
|
$good_input = true;
|
||||||
|
|
||||||
if (!filter_var($_POST['channel'], FILTER_VALIDATE_INT)) {
|
if (!filter_var($_POST['channel'], FILTER_VALIDATE_INT)) {
|
||||||
error_log("Attempting to set channel to invalid number.");
|
$status->addMessage('Attempting to set channel to invalid number.', 'danger');
|
||||||
return false;
|
$good_input = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (intval($_POST['channel']) < 1 || intval($_POST['channel']) > 48) {
|
if (intval($_POST['channel']) < 1 || intval($_POST['channel']) > RASPI_5GHZ_MAX_CHANNEL) {
|
||||||
error_log("Attempting to set channel to '".$_POST['channel']."'");
|
$status->addMessage('Attempting to set channel outside of permitted range', 'danger');
|
||||||
return false;
|
$good_input = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$good_input = true;
|
|
||||||
|
|
||||||
// Check for Bridged AP mode checkbox
|
// Check for Bridged AP mode checkbox
|
||||||
$bridgedEnable = 0;
|
$bridgedEnable = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user