Changeset 1499
- Timestamp:
- 06/21/06 13:54:44 (2 years ago)
- Files:
-
- trunk/lib/config/sfValidatorConfigHandler.class.php (modified) (1 diff)
- trunk/lib/util/sfToolkit.class.php (modified) (1 diff)
- trunk/lib/validator/sfValidatorManager.class.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/config/sfValidatorConfigHandler.class.php
r1415 r1499 344 344 } 345 345 } 346 else if (strpos($name, '{') != false || strpos($name, '}') != false)346 else if (strpos($name, '{') !== false || strpos($name, '}') !== false) 347 347 { 348 348 // name contains an invalid character trunk/lib/util/sfToolkit.class.php
r1415 r1499 346 346 return preg_replace(array_keys($replacePairs), array_values($replacePairs), $search); 347 347 } 348 349 public static function isArrayValuesEmpty($array) 350 { 351 static $isEmpty = true; 352 foreach($array as $value) 353 { 354 $isEmpty = (is_array($value)) ? self::isArrayValuesEmpty($value) : (strlen($value) == 0); 355 if (!$isEmpty) break; 356 } 357 358 return $isEmpty; 359 } 348 360 } trunk/lib/validator/sfValidatorManager.class.php
r1415 r1499 254 254 ($data['is_file'] && !$value['name']) 255 255 || 256 (!$data['is_file'] && ( $value == null || strlen($value) == 0))256 (!$data['is_file'] && (is_array($value) ? sfToolkit::isArrayValuesEmpty($value) : ($value == null || strlen($value) == 0))) 257 257 ) 258 258 {