aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2014-03-16 14:09:46 -0500
committerNathan Guse <nathaniel.guse@gmail.com>2014-03-16 14:09:46 -0500
commit5f70518987838b927ebeae504113cb4bc6e8f722 (patch)
tree00a874923ce25a01b6056755be13aefb176ebc66
parent69c195687f2bdbbc2f21094432b1ee4f74c2d414 (diff)
parentdf0ac9876c794be0bfc49bfdcfd50366afa88d49 (diff)
downloadforums-5f70518987838b927ebeae504113cb4bc6e8f722.tar
forums-5f70518987838b927ebeae504113cb4bc6e8f722.tar.gz
forums-5f70518987838b927ebeae504113cb4bc6e8f722.tar.bz2
forums-5f70518987838b927ebeae504113cb4bc6e8f722.tar.xz
forums-5f70518987838b927ebeae504113cb4bc6e8f722.zip
Merge pull request #2136 from Elsensee/ticket/11071
[ticket/11071] Add fallback if requested style don't exist
-rw-r--r--phpBB/phpbb/user.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php
index 2a7cc602da..6c060e21ea 100644
--- a/phpBB/phpbb/user.php
+++ b/phpBB/phpbb/user.php
@@ -204,6 +204,19 @@ class user extends \phpbb\session
$this->style = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
+ // Fallback to user's standard style
+ if (!$this->style && $style_id != $this->data['user_style'])
+ {
+ $style_id = $this->data['user_style'];
+
+ $sql = 'SELECT *
+ FROM ' . STYLES_TABLE . " s
+ WHERE s.style_id = $style_id";
+ $result = $db->sql_query($sql, 3600);
+ $this->style = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+ }
+
// User has wrong style
if (!$this->style && $style_id == $this->data['user_style'])
{