Changeset 2742
- Timestamp:
- 06/02/2008 12:51:45 PM (4 months ago)
- Location:
- trunk/system
- Files:
-
- 5 modified
-
config/session.php (modified) (1 diff)
-
helpers/valid.php (modified) (1 diff)
-
i18n/en_US/session.php (modified) (1 diff)
-
i18n/nl_NL/session.php (modified) (1 diff)
-
libraries/Session.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/config/session.php
r2594 r2742 13 13 14 14 /** 15 * Default session name.16 * It should contain only alphanumeric characters and at least one letter shouldbe present.15 * Session name. 16 * It must contain only alphanumeric characters and underscores. At least one letter must be present. 17 17 */ 18 18 $config['name'] = 'kohanasession'; -
trunk/system/helpers/valid.php
r2728 r2742 289 289 } 290 290 291 /**292 * Checks if a string is a valid identifier.293 *294 * @param string input string295 * @return boolean296 */297 public static function id($str)298 {299 return (bool) preg_match('/^[a-z][a-z0-9_]++$/iD', (string) $str);300 }301 302 291 } // End valid -
trunk/system/i18n/en_US/session.php
r2667 r2742 3 3 $lang = array 4 4 ( 5 'invalid_session_name' => 'The session_name, %s, is invalid. It should contain only alphanumeric characters and at least one letter shouldbe 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.', 6 6 ); -
trunk/system/i18n/nl_NL/session.php
r2667 r2742 3 3 $lang = array 4 4 ( 5 'invalid_session_name' => 'De sessie naam, %s, is ongeldig. Hij mag alleen maar bestaan uit alfanumerieke karakters en moetminstens éé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.', 6 6 ); -
trunk/system/libraries/Session.php
r2730 r2742 89 89 90 90 // 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'])) 92 92 throw new Kohana_Exception('session.invalid_session_name', self::$config['name']); 93 93
