Changeset 3257

Show
Ignore:
Timestamp:
08/04/2008 08:38:41 PM (4 months ago)
Author:
Shadowhand
Message:

Fixing #686, thanks galli.

Files:
1 modified

Legend:

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

    r2970 r3257  
    5858                        return $this->is_valid; 
    5959 
    60                 // No data to validate 
    6160                if ($this->input_value() == FALSE) 
     61                { 
     62                        // No data to validate 
    6263                        return $this->is_valid = FALSE; 
     64                } 
    6365 
    6466                // Load the submitted value 
    6567                $this->load_value(); 
    6668 
    67                 // Use array_key_exists because it properly tests NULL 
    68                 return array_key_exists($this->value, $this->data['options']); 
     69                if ( ! array_key_exists($this->value, $this->data['options'])) 
     70                { 
     71                        // Value does not exist in the options 
     72                        return $this->is_valid = FALSE; 
     73                } 
     74 
     75                return parent::validate(); 
    6976        } 
    7077