Changeset 2334
- Timestamp:
- 03/24/2008 09:56:23 AM (8 months ago)
- Files:
-
- 1 modified
-
trunk/system/libraries/Validation.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/libraries/Validation.php
r2223 r2334 30 30 protected $messages = array(); 31 31 32 // Checks if there is data to validate. 33 protected $submitted; 34 32 35 /** 33 36 * Creates a new Validation instance. … … 52 55 // Set a dynamic, unique "any field" key 53 56 $this->any_field = uniqid(NULL, TRUE); 57 58 // Test if there is any actual data 59 $this->submitted = (count($array) > 0); 54 60 55 61 parent::__construct($array, ArrayObject::ARRAY_AS_PROPS | ArrayObject::STD_PROP_LIST); … … 312 318 )); 313 319 314 // Only run validation when POST data exists315 $run_validation = (count($this) > 0);316 317 320 foreach ($all_fields as $i => $field) 318 321 { … … 328 331 } 329 332 330 if ($ run_validation=== FALSE)333 if ($this->submitted === FALSE) 331 334 return FALSE; 332 335
