]>
git.bts.cx Git - cx.git/blob - cx/lib/form.php
3 function cx_form_input_sanitized($name) {
4 $input = cx_form_input_sanitized_allowing_html($name);
7 $input = strip_tags($input);
13 function cx_form_input_sanitized_allowing_html($name) {
14 if (array_key_exists($name, $_POST)) {
15 $insecure_input = $_POST[$name];
16 return $insecure_input;
22 function cx_form_input_sanitized_date_time($name) {
23 $sanitised_string = cx_form_input_sanitized($name);
25 if ($sanitised_string != null) {
26 $date = date_parse_from_format('Y-m-d H:i:s', $sanitised_string);
27 if ($date['error_count'] > 0) $date = date_parse_from_format('Y-m-d', $sanitised_string);
28 if ($date['error_count'] == 0) {
29 $timestamp = mktime($date['hour'], $date['minute'], $date['second'], $date['month'], $date['day'], $date['year']);
30 if ($timestamp != false) {