Commit 98f34182 authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic
Browse files

Bug 1660502: Checking if theme exists when creating user

Checks if the theme exists before creating
the profile page for a new user

behatnotneeded

Change-Id: Ia3a49588c02032b427be0559a8f9fea98975f0d9
parent 2b5f8c4e
......@@ -579,7 +579,8 @@ class View {
$owner->find_by_id($viewdata['owner']);
}
$ownerthemedata = $owner->get('institutiontheme');
$ownertheme = isset($ownerthemedata->basename) ? $ownerthemedata->basename : null;
$themeoptions = get_all_themes();
$ownertheme = (isset($ownerthemedata->basename) && array_key_exists($ownerthemedata->basename, $themeoptions)) ? $ownerthemedata->basename : null;
if ($accounttheme = $owner->get_account_preference('theme')) {
$accountthemeparts = explode('/', $accounttheme);
$ownertheme = $accountthemeparts[0];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment