Merge pull request #2448 from drshawnkwang/drupal_fix-languageflagbug

Drupal: Fix bug when there is no language, a default flag should appear.
This commit is contained in:
tristanolive 2018-04-12 09:31:01 -04:00 committed by GitHub
commit d40296279f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -192,6 +192,10 @@ function boinc_preprocess_page(&$vars, $hook) {
$locality = $lang_code[0];
}
}
// If there is no language set for some reason, default to English (en).
if (empty($locality)) {
$locality = "en";
}
$vars['flag_path'] = base_path() . path_to_theme() . "/images/flags/{$locality}.png";
$server_status_url = variable_get('boinc_server_status_url', '');