[ticket/10198] validate_config_vars() improperly validates multibyte strings

PHPBB3-10198
This commit is contained in:
rxu 2011-06-05 23:02:56 +08:00 committed by Nils Adermann
parent 116744d4e5
commit eb0ffd3503

View file

@ -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;