mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-03 06:08:05 +02:00
Merge remote-tracking branch 'naderman/ticket/10198' into develop-olympus
* naderman/ticket/10198: [ticket/10198] range validation for strings should limit characters not bytes [ticket/10198] validate_config_vars() improperly validates multibyte strings
This commit is contained in:
commit
a4f7002995
@ -402,7 +402,7 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
|
|||||||
switch ($validator[$type])
|
switch ($validator[$type])
|
||||||
{
|
{
|
||||||
case 'string':
|
case 'string':
|
||||||
$length = strlen($cfg_array[$config_name]);
|
$length = utf8_strlen($cfg_array[$config_name]);
|
||||||
|
|
||||||
// the column is a VARCHAR
|
// the column is a VARCHAR
|
||||||
$validator[$max] = (isset($validator[$max])) ? min(255, $validator[$max]) : 255;
|
$validator[$max] = (isset($validator[$max])) ? min(255, $validator[$max]) : 255;
|
||||||
@ -600,7 +600,7 @@ function validate_range($value_ary, &$error)
|
|||||||
{
|
{
|
||||||
case 'string' :
|
case 'string' :
|
||||||
$max = (isset($column[1])) ? min($column[1],$type['max']) : $type['max'];
|
$max = (isset($column[1])) ? min($column[1],$type['max']) : $type['max'];
|
||||||
if (strlen($value['value']) > $max)
|
if (utf8_strlen($value['value']) > $max)
|
||||||
{
|
{
|
||||||
$error[] = sprintf($user->lang['SETTING_TOO_LONG'], $user->lang[$value['lang']], $max);
|
$error[] = sprintf($user->lang['SETTING_TOO_LONG'], $user->lang[$value['lang']], $max);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user