Changeset 2969

Show
Ignore:
Timestamp:
07/06/2008 06:43:11 PM (5 months ago)
Author:
Shadowhand
Message:

Fixing #609, thanks Stalwart.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/modules/forge/libraries/Form_Dropdown.php

    r2706 r2969  
    5252        } 
    5353 
     54        public function validate() 
     55        { 
     56                // Validation has already run 
     57                if (is_bool($this->is_valid)) 
     58                        return $this->is_valid; 
     59 
     60                // No data to validate 
     61                if ($this->input_value() === NULL) 
     62                        return $this->is_valid = FALSE; 
     63 
     64                // Load the submitted value 
     65                $this->load_value(); 
     66 
     67                // Use array_key_exists because it properly tests NULL 
     68                return array_key_exists($this->value, $this->data['options']); 
     69        } 
     70 
    5471} // End Form Dropdown