Skip to content

Commit

Permalink
More form generator number validations
Browse files Browse the repository at this point in the history
Similar to the previous commit, but looking at other fields that aren't
validating as numeric correctly. Addresses issue LibriVox#156.
  • Loading branch information
garethsime committed Aug 21, 2023
1 parent 30784a6 commit a5c29b3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions application/controllers/public/Project_launch.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,19 +223,20 @@ private function _validate_form()
$this->form_validation->set_rules('project_type', 'lang:proj_launch_type_of_project', 'trim|xss_clean|alpha_dash');
$this->form_validation->set_rules('recorded_language', 'lang:proj_launch_recorded_language', 'trim|xss_clean|numeric');
$this->form_validation->set_rules('title', 'lang:proj_launch_title', 'trim|xss_clean|required');
$this->form_validation->set_rules('edition_year', 'lang:proj_launch_edition_year', 'trim|xss_clean|numeric');
$this->form_validation->set_rules('brief_summary', 'Brief Summary', 'trim|xss_clean');
$this->form_validation->set_rules('brief_summary_by', 'Brief Summary By', 'trim|xss_clean');
$this->form_validation->set_rules('link_to_text', 'lang:proj_launch_link_to_text_1', 'trim|xss_clean|prep_url');

$this->form_validation->set_rules('link_to_book', 'lang:proj_launch_link_to_book', 'trim|xss_clean|prep_url');
$this->form_validation->set_rules('pub_year', 'lang:proj_launch_pub_year', 'trim|xss_clean');
$this->form_validation->set_rules('pub_year', 'lang:proj_launch_pub_year', 'trim|xss_clean|numeric');

$this->form_validation->set_rules('expected_completion_year', 'lang:proj_launch_expected_completion', 'trim|xss_clean');
$this->form_validation->set_rules('expected_completion_month', 'lang:proj_launch_expected_completion', 'trim|xss_clean');
$this->form_validation->set_rules('expected_completion_day', 'lang:proj_launch_expected_completion', 'trim|xss_clean');
$this->form_validation->set_rules('expected_completion_year', 'lang:proj_launch_expected_completion', 'trim|xss_clean|numeric');
$this->form_validation->set_rules('expected_completion_month', 'lang:proj_launch_expected_completion', 'trim|xss_clean|numeric');
$this->form_validation->set_rules('expected_completion_day', 'lang:proj_launch_expected_completion', 'trim|xss_clean|numeric');

$this->form_validation->set_rules('proof_level', 'lang:proj_launch_proof_level', 'trim|xss_clean|alpha_dash');
$this->form_validation->set_rules('num_sections', 'lang:proj_launch_num_sections', 'trim|xss_clean');
$this->form_validation->set_rules('num_sections', 'lang:proj_launch_num_sections', 'trim|xss_clean|numeric');

$this->form_validation->set_rules('has_preface', 'lang:proj_launch_has_preface', 'trim|xss_clean|exact_length[1]');

Expand Down

0 comments on commit a5c29b3

Please sign in to comment.