Skip to content

Commit

Permalink
Added a utility function
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlad committed Jun 22, 2011
1 parent e068266 commit 7b9f13a
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions lib/class.languager.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ private function __construct(){
$this->_language_code = $this->_region ? $this->_language.'-'.$this->_region : $this->_language;

$supported_language_codes = explode(',', General::sanitize(Symphony::Configuration()->get('language_codes', 'language_redirect')));
$supported_language_codes = array_map('trim', $supported_language_codes);
$this->_supported_language_codes = array_filter($supported_language_codes);

$this->_supported_language_codes = self::cleanLanguageCodes($supported_language_codes);
}

public static function instance() {
Expand Down Expand Up @@ -253,4 +253,16 @@ public function getSupportedLanguageCodes(){
public function getAllLanguages(){
return $this->_languages;
}



/*------------------------------------------------------------------------------------------------*/
/* Utilities */
/*------------------------------------------------------------------------------------------------*/
public static function cleanLanguageCodes($language_codes){
$clean = array_map('trim', $language_codes);
$clean = array_filter($clean);

return $clean;
}
}

0 comments on commit 7b9f13a

Please sign in to comment.