Changeset 2742

Show
Ignore:
Timestamp:
06/02/2008 12:51:45 PM (4 months ago)
Author:
Geert
Message:

Follow-up on #622. Cleaning up comments and i18n. Also dropping valid::id().

Location:
trunk/system
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/config/session.php

    r2594 r2742  
    1313 
    1414/** 
    15  * Default session name. 
    16  * It should contain only alphanumeric characters and at least one letter should be present. 
     15 * Session name. 
     16 * It must contain only alphanumeric characters and underscores. At least one letter must be present. 
    1717 */ 
    1818$config['name'] = 'kohanasession'; 
  • trunk/system/helpers/valid.php

    r2728 r2742  
    289289        } 
    290290 
    291         /** 
    292          * Checks if a string is a valid identifier. 
    293          * 
    294          * @param   string   input string 
    295          * @return  boolean 
    296          */ 
    297         public static function id($str) 
    298         { 
    299                 return (bool) preg_match('/^[a-z][a-z0-9_]++$/iD', (string) $str); 
    300         }     
    301  
    302291} // End valid 
  • trunk/system/i18n/en_US/session.php

    r2667 r2742  
    33$lang = array 
    44( 
    5         'invalid_session_name' => 'The session_name, %s, is invalid. It should contain only alphanumeric characters and at least one letter should be present.', 
     5        'invalid_session_name' => 'The session_name, %s, is invalid. It must contain only alphanumeric characters and underscores. Also at least one letter must be present.', 
    66); 
  • trunk/system/i18n/nl_NL/session.php

    r2667 r2742  
    33$lang = array 
    44( 
    5         'invalid_session_name' => 'De sessie naam, %s, is ongeldig. Hij mag alleen maar bestaan uit alfanumerieke karakters en moet minstens één letter bevatten.', 
     5        'invalid_session_name' => 'De sessienaam, %s, is ongeldig. Hij mag alleen maar bestaan uit alfanumerieke tekens en underscores. Hij moet ook minstens één letter bevatten.', 
    66); 
  • trunk/system/libraries/Session.php

    r2730 r2742  
    8989 
    9090                        // Set the session name after having checked it 
    91                         if ( ! valid::id(self::$config['name'])) 
     91                        if ( ! preg_match('~^(?=.*[a-z])[a-z0-9_]++$~iD', self::$config['name'])) 
    9292                                throw new Kohana_Exception('session.invalid_session_name', self::$config['name']); 
    9393