aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/profilefields/type/type_string_common.php2
-rw-r--r--phpBB/phpbb/user.php13
2 files changed, 14 insertions, 1 deletions
diff --git a/phpBB/phpbb/profilefields/type/type_string_common.php b/phpBB/phpbb/profilefields/type/type_string_common.php
index 0738cbdafd..78e219a61f 100644
--- a/phpBB/phpbb/profilefields/type/type_string_common.php
+++ b/phpBB/phpbb/profilefields/type/type_string_common.php
@@ -65,7 +65,7 @@ abstract class type_string_common extends type_base
{
return $this->user->lang('FIELD_TOO_SHORT', (int) $field_data['field_minlen'], $this->get_field_name($field_data['lang_name']));
}
- else if ($field_data['field_maxlen'] && utf8_strlen($field_value) > $field_data['field_maxlen'])
+ else if ($field_data['field_maxlen'] && utf8_strlen(html_entity_decode($field_value)) > $field_data['field_maxlen'])
{
return $this->user->lang('FIELD_TOO_LONG', (int) $field_data['field_maxlen'], $this->get_field_name($field_data['lang_name']));
}
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'])
{