Changeset 2869 for trunk/system/libraries/Validation.php
- Timestamp:
- 06/20/2008 10:19:28 AM (5 months ago)
- Files:
-
- 1 modified
-
trunk/system/libraries/Validation.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/libraries/Validation.php
r2670 r2869 92 92 /** 93 93 * Returns the ArrayObject values, removing all inputs without rules. 94 * To choose specific inputs, list the field name as arguments. 94 95 * 95 96 * @return array … … 106 107 )); 107 108 109 // Load choices 110 $choices = func_get_args(); 111 $choices = empty($choices) ? NULL : array_combine($choices, $choices); 112 108 113 $safe = array(); 109 114 foreach ($all_fields as $i => $field) … … 118 123 } 119 124 120 // Make sure all fields are defined 121 $safe[$field] = isset($this[$field]) ? $this[$field] : NULL; 125 if ($choices === NULL OR isset($choices[$field])) 126 { 127 // Make sure all fields are defined 128 $safe[$field] = isset($this[$field]) ? $this[$field] : NULL; 129 } 122 130 } 123 131
