Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
in Q2A Core by


qa-filter-basic.php :
function filter_handle(&$handle, $olduser)
if (qa_strlen($handle)<3)
return qa_lang_sub('main/min_length_user_x', 3);
if (!strlen($handle))
return qa_lang('users/handle_empty');
if (preg_match('/[\\@\\+\\/]/', $handle))
return qa_lang_sub('users/handle_has_bad', '@ + /');
if (qa_strlen($handle)>QA_DB_MAX_HANDLE_LENGTH)
return qa_lang_sub('main/max_length_x', QA_DB_MAX_HANDLE_LENGTH);
Q2A version: v1.5
related to an answer for: Minimum and maximum length of username ???
Or better still, use a filter module in a separate plugin, so that it can easily me moved to future versions of Q2A.

1 Answer

0 votes

see answer of Krzysztof Kielce - quote:

Put this line somewhere in your qa-config.php file:
define('QA_DB_MAX_HANDLE_LENGTH', 30);

set your username's length instead of "30"