Hi,
I hooked a function at global_bootstrap_complete to register an unknown user before login process is called (my intention look here
https://vborg.vbsupport.ru/showthread.php?t=283789).
For the registering process I'm using the user data manager as well as the function verify_username($username). But this method will fail cause of a missing 'charset' style variable.
To determine the username length the function vbstrlen is called which in turn calls mb_strlen($username, $encoding);
Because of missing the missing charset string in $vbulletin->stylevars['charset'] it will fail by throwing an exception 'Unknown encoding'.
PHP Code:
// function.php->vbstrlen()
if (function_exists('mb_strlen') AND $length = @mb_strlen($string, vB_Template_Runtime::fetchStyleVar('charset')))
{
return $length;
}
else
{
return strlen($string);
}
So, at which point the stylevars will be set or how can I manually set a charset?
Currently I came with a quick and dirty solution by setting charset manually
PHP Code:
vB_Template_Runtime::addStyleVar('charset', 'utf-8');'
But I couldn't find the location in the code where the stylevars are set/determined.
Maybe there is a more suitable approach.
TIA
Greetings
Bundschuh