Make sure we only store numbers for station power

This commit is contained in:
phl0
2023-04-28 14:04:59 +02:00
parent 057b639d99
commit 0fa9d5066e
2 changed files with 3 additions and 3 deletions

View File

@@ -75,7 +75,7 @@ class Stations extends CI_Model {
'station_sig' => xss_clean(strtoupper($this->input->post('sig', true))),
'station_sig_info' => xss_clean(strtoupper($this->input->post('sig_info', true))),
'station_callsign' => xss_clean($this->input->post('station_callsign', true)),
'station_power' => xss_clean($this->input->post('station_power', true)),
'station_power' => is_numeric(xss_clean($this->input->post('station_power', true))) ? xss_clean($this->input->post('station_power', true)) : NULL,
'station_dxcc' => xss_clean($this->input->post('dxcc', true)),
'station_cnty' => xss_clean($this->input->post('station_cnty', true)),
'station_cq' => xss_clean($this->input->post('station_cq', true)),
@@ -108,7 +108,7 @@ class Stations extends CI_Model {
'station_sig' => xss_clean($this->input->post('sig', true)),
'station_sig_info' => xss_clean($this->input->post('sig_info', true)),
'station_callsign' => xss_clean($this->input->post('station_callsign', true)),
'station_power' => xss_clean($this->input->post('station_power', true)),
'station_power' => is_numeric(xss_clean($this->input->post('station_power', true))) ? xss_clean($this->input->post('station_power', true)) : NULL,
'station_dxcc' => xss_clean($this->input->post('dxcc', true)),
'station_cnty' => xss_clean($this->input->post('station_cnty', true)),
'station_cq' => xss_clean($this->input->post('station_cq', true)),

View File

@@ -42,7 +42,7 @@
<div class="form-group">
<label for="stationPowerInput">Station Power</label>
<input type="number" class="form-control" name="station_power" id="stationPowerInput" step="1" aria-describedby="stationPowerInputHelp" placeholder="10" required>
<input type="number" class="form-control" name="station_power" id="stationPowerInput" step="1" aria-describedby="stationPowerInputHelp" placeholder="10">
<small id="stationPowerInputHelp" class="form-text text-muted">Default station power. Overwritten by CAT.</small>
</div>