]>
git.bts.cx Git - cx.git/blob - cx/lib/form.php
3 function cx_form_input_sanitized($name) {
4 if (array_key_exists($name, $_POST)) {
5 $insecure_input = $_POST[$name];
6 $tagless_input = strip_tags($insecure_input);
13 function cx_form_input_sanitized_date_time($name) {
14 $sanitised_string = cx_form_input_sanitized($name);
16 if ($sanitised_string != null) {
17 $date = date_parse_from_format('Y-m-d H:i:s', $sanitised_string);
18 if ($date['error_count'] > 0) $date = date_parse_from_format('Y-m-d', $sanitised_string);
19 if ($date['error_count'] == 0) {
20 $timestamp = mktime($date['hour'], $date['minute'], $date['second'], $date['month'], $date['day'], $date['year']);
21 if ($timestamp != false) {