Changeset 2028

Show
Ignore:
Timestamp:
02/11/2008 06:39:25 AM (9 months ago)
Author:
Geert
Message:

Fixing storage of User_agent languages and charsets:

  • Before: array { [0] => array { [0] => 'en', [1] => 'fr' } }
  • After: array { [0] => 'en', [1] => 'fr' }
Files:
1 modified

Legend:

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

    r1911 r2028  
    6060                if (empty(self::$languages) AND ! empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) 
    6161                { 
    62                         preg_match_all('/[-a-z]{2,}/i', trim($_SERVER['HTTP_ACCEPT_LANGUAGE']), self::$languages); 
     62                        self::$languages = (preg_match_all('/[-a-z]{2,}/', strtolower(trim($_SERVER['HTTP_ACCEPT_LANGUAGE'])), $matches)) ? $matches[0] : array(); 
    6363                } 
    6464 
     
    6666                if (empty(self::$charsets) AND ! empty($_SERVER['HTTP_ACCEPT_CHARSET'])) 
    6767                { 
    68                         preg_match_all('/[-a-z0-9]{2,}/i', trim($_SERVER['HTTP_ACCEPT_CHARSET']), self::$charsets); 
     68                        self::$charsets = (preg_match_all('/[-a-z0-9]{2,}/', strtolower(trim($_SERVER['HTTP_ACCEPT_CHARSET'])), $matches)) ? $matches[0] : array(); 
    6969                } 
    7070