mirror of
https://github.com/PHPMailer/PHPMailer.git
synced 2024-09-20 18:03:04 +02:00
Merge pull request #174 from mmeyer2k/patch-1
Remove usage of error control operator in setLanguage()
This commit is contained in:
commit
556e51e753
@ -1380,8 +1380,14 @@ class PHPMailer
|
||||
//Overwrite language-specific strings.
|
||||
//This way we'll never have missing translations - no more "language string failed to load"!
|
||||
$l = true;
|
||||
$lang_file = $lang_path . 'phpmailer.lang-' . $langcode . '.php';
|
||||
if ($langcode != 'en') { //There is no English translation file
|
||||
$l = @include $lang_path . 'phpmailer.lang-' . $langcode . '.php';
|
||||
//Make sure language file path is readable
|
||||
if (!is_readable($lang_file)) {
|
||||
$l = false;
|
||||
} else {
|
||||
$l = include $lang_file;
|
||||
}
|
||||
}
|
||||
$this->language = $PHPMAILER_LANG;
|
||||
return ($l == true); //Returns false if language not found
|
||||
|
Loading…
Reference in New Issue
Block a user