--- UserInputOrig/src/input_form.php	2007-09-07 05:40:32.000000000 +0200
+++ UserInput/src/input_form.php	2007-09-07 06:22:33.000000000 +0200
@@ -209,31 +209,15 @@
 
         foreach ( $this->definition as $elementName => $inputElement )
         {
-            $hasVariable = filter_has_var( $this->inputSource, $elementName );
-            if ( ! $hasVariable )
+            $result = $inputElement->parseInput( $this->inputSource, $elementName );
+            if ( $result == ezcInputForm::INVALID )
             {
-                if ( $inputElement->type == ezcInputFormDefinitionElement::REQUIRED )
-                {
-                    throw new ezcInputFormVariableMissingException( $elementName );
-                }
-                else
-                {
-                    $this->properties[$elementName] = ezcInputForm::INVALID;
-                    continue;
-                }
-            }
-
-            $flags = FILTER_NULL_ON_FAILURE | $inputElement->flags;
-            $value = filter_input( $this->inputSource, $elementName, filter_id( $inputElement->filterName ), array( 'options' => $inputElement->options, 'flags' => $flags ) );
-
-            if ( $value !== null )
-            {
-                $this->properties[$elementName] = ezcInputForm::VALID;
-                $this->propertyValues[$elementName] = $value;
+                $this->properties[$elementName] = ezcInputForm::INVALID;
             }
             else
             {
-                $this->properties[$elementName] = ezcInputForm::INVALID;
+                $this->properties[$elementName] = ezcInputForm::VALID;
+                $this->propertyValues[$elementName] = $result;
             }
         }
     }
--- UserInputOrig/src/structs/definition_element.php	2007-09-07 05:40:32.000000000 +0200
+++ UserInput/src/structs/definition_element.php	2007-09-07 06:25:31.000000000 +0200
@@ -107,5 +107,32 @@
     {
         return new ezcInputFormDefinitionElement( $array['type'], $array['filterName'], $array['options'], $array['flags'], $array['hint'] );
     }
+    
+    public function parseInput( $inputSource, $elementName )
+    {
+        $hasVariable = filter_has_var( $inputSource, $elementName );
+        if ( ! $hasVariable )
+        {
+            if ( $this->type == ezcInputFormDefinitionElement::REQUIRED )
+            {
+                throw new ezcInputFormVariableMissingException( $elementName );
+            }
+            else
+            {
+                return ezcInputForm::INVALID;
+            }
+        }
+        $flags = FILTER_NULL_ON_FAILURE | $inputElement->flags;
+        $value = filter_input( $inputSource, $elementName, filter_id( $this->filterName ), array( 'options' => $this->options, 'flags' => $flags ) );
+
+        if ( $value !== null )
+        {
+            return $value;
+        }
+        else
+        {
+            return ezcInputForm::INVALID;
+        }
+    }
 }
 ?>
