![]() |
verify_username fails with missing charset in stylevars
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:
Currently I came with a quick and dirty solution by setting charset manually PHP Code:
Maybe there is a more suitable approach. TIA Greetings Bundschuh |
Admin CP -> Languages & Phrases -> Language Manager -> [Edit Settings] -> HTML Character Set (needs to be set UTF-8)
Make sure everything else in the forum matches though. |
To be honest I don't understand the hook situation. A comment in global.php says that hook "global_setup_complete" is deprecated, but it appears to be the only "global" hook that is called after the style has been loaded (and it seems like if they are going to suggest that global_bootstrap_complete is a replacement that it should be mostly equivalent). So anyway, maybe you should try using hook global_setup_complete and if they ever do get around to removing it you can deal with it then.
|
Thanks for you answers.
@futureaudio: I'd like to avoid changes in admincp to make a plugin running. But thanks for the advice, I will give this a try. @kh99: I was asking myself the same question especially because the functions load_style() and process_templates() are commented out in class_bootstrap.php->bootstrap(). Maybe it's as you described, if they remove the hooks in global.php they will also have to call style and templates in bootstrap itself. Greetings Bundschuh |
All times are GMT. The time now is 11:47 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|