Skip to content

Commit

Permalink
Merge pull request PHPMailer#174 from mmeyer2k/patch-1
Browse files Browse the repository at this point in the history
Remove usage of error control operator in setLanguage()
  • Loading branch information
Synchro committed Jan 29, 2014
2 parents 9c88572 + 2f773d1 commit 556e51e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion class.phpmailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1380,8 +1380,14 @@ public function setLanguage($langcode = 'en', $lang_path = 'language/')
//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
Expand Down

0 comments on commit 556e51e

Please sign in to comment.