Adding this snippet of code at qa-include/pages/register.php:90 is enough.
if (strpos(trim($inhandle),' ')) { $qa_content=qa_content_prepare(); $qa_content['error'] ="Spaces are not allowed in username!"; return $qa_content; }
if (strpos(trim($inhandle),' ')) {
$qa_content=qa_content_prepare();
$qa_content['error'] ="Spaces are not allowed in username!";
return $qa_content;
}
Edit: To prevent username from being changed after register, you may use this code at qa-include/pages/account.php after 92 line.
if (strpos(trim($inhandle),' ')) { $errors['handle']="Spaces are not allowed in username!"; }
Add this code at qa-include/plugins/qa-filter-basic.php:51
if (preg_match('/\\s/', $handle)) { return qa_lang_sub('users/handle_has_bad', 'space'); }
if (preg_match('/\\s/', $handle)) {
return qa_lang_sub('users/handle_has_bad', 'space');
Welcome to the Q&A site for Question2Answer.
If you have a question about Q2A, please ask here, in English.
To report a bug, please create a new issue on Github or ask a question here with the bug tag.
If you just want to try Q2A, please use the demo site.