mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-26 11:19:55 +03:00
Use default theme if loaded one is not found
When loading a user's theme, make sure it's installed. Also, when determining the default theme, account for the situation in which zero themes are installed (and use 'default' then). Refs #1061
This commit is contained in:
parent
63bbba8e36
commit
7b6912ba98
1 changed files with 3 additions and 2 deletions
|
@ -299,9 +299,10 @@ function build_user($user_id, $use_cache=true)
|
|||
}
|
||||
|
||||
// Check user theme
|
||||
if (!isset($user['theme_name']))
|
||||
if (!isset($user['theme_name']) || !check_theme_installed($user['theme_name']))
|
||||
{
|
||||
$user['theme'] = get_default_theme();
|
||||
$user['theme_name'] = $user['theme'];
|
||||
}
|
||||
|
||||
return $user;
|
||||
|
@ -777,7 +778,7 @@ function get_default_theme()
|
|||
|
||||
// let's find the first available theme
|
||||
$active_themes = array_keys(get_pwg_themes());
|
||||
return $active_themes[0];
|
||||
return isset($active_themes[0]) ? $active_themes[0] : 'default';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue