Changeset 3045

Show
Ignore:
Timestamp:
07/11/2008 02:16:17 AM (5 months ago)
Author:
Geert
Message:

Allowing to pass config group string to Captcha constructor.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/libraries/Captcha.php

    r3043 r3045  
    3232         * Constructs and returns a new Captcha object. 
    3333         * 
    34          * @param   array   configuration settings 
     34         * @param   string|array  config group or settings 
    3535         * @return  object 
    3636         */ 
     
    4444         * 
    4545         * @throws  Kohana_Exception 
    46          * @param   array  configuration settings 
     46         * @param   string|array  config group or settings 
    4747         * @return  void 
    4848         */ 
     
    5555                        throw new Kohana_Exception('captcha.requires_GD2'); 
    5656 
     57                // Only config group name given 
     58                if (is_string($config)) 
     59                { 
     60                        $config = array('group' => $config); 
     61                } 
    5762                // No custom config group name given 
    58                 if ( ! isset($config['group'])) 
     63                elseif ( ! isset($config['group'])) 
    5964                { 
    6065                        $config['group'] = 'default';