Projet

Général

Profil

Révision 137a4cfc

Ajouté par Jocelyn Delande il y a presque 11 ans

does the same upload job, bet refactored the form and receive action for future

Voir les différences:

class/FormValidator.class.php
40 40
						$sanitized_f = $request[$fieldname];
41 41
					}
42 42
				} else {
43
					$val = $request[$fieldname];
44
					try {
45
						$sanitized_f = $this->validate_field($validator, $val);
46
					} catch (FieldValidationError $e) {
47
						$err = $e->getMessage();
48
						break;
43
					if (isset($request[$fieldname]) and $request[$fieldname]) {
44
						$val = $request[$fieldname];
45
						try {
46
							$sanitized_f = $this->validate_field($validator, $val);
47
						} catch (FieldValidationError $e) {
48
							$err = $e->getMessage();
49
							break;
50
						}
49 51
					}
50 52
				}
51 53
			}
......
92 94
  'numeric',
93 95
  function ($v) {
94 96
	  $sanitized = floatval($v);
95
    if ($sanitized === false) {
97
	  if (($sanitized === false) || (!is_numeric($v))) {
96 98
	  	throw new FieldValidationError('n\'est pas une valeur numérique');
97 99
	  } else {
98 100
		  return $sanitized;

Formats disponibles : Unified diff