Skip to content

Commit

Permalink
Fix language code check
Browse files Browse the repository at this point in the history
  • Loading branch information
Synchro committed Jul 26, 2016
1 parent 90f1924 commit 6a6165f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion class.phpmailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1717,7 +1717,7 @@ public function setLanguage($langcode = 'en', $lang_path = '')
$lang_path = dirname(__FILE__). DIRECTORY_SEPARATOR . 'language'. DIRECTORY_SEPARATOR;
}
//Validate $langcode
if (!preg_match('/^[a-z]{2}$/', $langcode)) {
if (!preg_match('/^[a-z]{2}(?:_[a-zA-Z]{2})?$/', $langcode)) {
$langcode = 'en';
}
$foundlang = true;
Expand Down

0 comments on commit 6a6165f

Please sign in to comment.