mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-09 03:13:35 +02:00
[ticket/11071] Add fallback if requested style don't exist
PHPBB3-11071
This commit is contained in:
@ -204,6 +204,19 @@ class user extends \phpbb\session
|
|||||||
$this->style = $db->sql_fetchrow($result);
|
$this->style = $db->sql_fetchrow($result);
|
||||||
$db->sql_freeresult($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
|
// User has wrong style
|
||||||
if (!$this->style && $style_id == $this->data['user_style'])
|
if (!$this->style && $style_id == $this->data['user_style'])
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user