Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
86 views
in Q2A Core by

1 Answer

0 votes
by
edited by
 
Best answer

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;

}

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!"; }

by
+1
Why this answer is flagged? Please unflag!
by
If you modify in  qa-include/pages/register.php, you can block those usernames when they register. But after that, they can edit their profiles!

This is not enough!
by
In this case, changing username option should be disabled or implement this code to there.
by
Answer has been updated..Take a look!
by
Or you can simply just  modify the filter_handle function found in /qa-include/plugins/qa-filter-basic.php . This will work in every case.
...