Skip to content

Commit

Permalink
Remove usage of error control operator
Browse files Browse the repository at this point in the history
  • Loading branch information
mmeyer2k committed Jan 29, 2014
1 parent 9c88572 commit d7cddca
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion class.phpmailer.php
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;
$path = $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($path)) {
$l = false;
} else {
$l = include $path;
}
}
$this->language = $PHPMAILER_LANG;
return ($l == true); //Returns false if language not found
Expand Down

0 comments on commit d7cddca

Please sign in to comment.