Next time, please include a "commit title" (the first line of the commit message) and name the branch "ticket/8736" as suggested by the git contribution guidelines. http://wiki.phpbb.com/display/DEV/Git
Why are you including the ucp language file? TOO_SHORT_USERNAME is in the common language file.
Apart from that, look good.
The ucp.php lang is needed for this, original code which was already in the code, I just moved it.
if (($result = validate_username($post_data['username'], (!empty($post_data['post_username'])) ? $post_data['post_username'] : '')) !== false)
as that checks for if the user name already exists, eg. I was not aware that TOO_LONG, etc were already in common.php. So I suppose just adding the check for the string length would suffice instead of moving the ucp.php include. Could possibly append the error message to state the minimum and maximum lengths in the display to the user?
I have bookmarked the link, btw. ^_^
Fair enough, it does make the code more readable in this case.
[ticket/8736] guest can have 255 chars long username
when you post as a guest (anonymous) you can fill the field username with 255 chars. that will destroy the prosilver and subsilver2 -Style at viewtopic..
settings for username in ACP: 6-16 Chars
Igor, I "reinvented" the wheel. The error message will now state minimum and maximum characters allowed instead of "TOO_SMALL" AND "TOO_LARGE". Calling language/en/ucp.php in the check so might as well use the vars available.
$error = sprintf($user->lang['FIELD_' . $result], $user->lang['USERNAME'], ($result == 'TOO_SHORT') ? $config['min_name_chars'] : $config['max_name_chars']);
Works for me.
Adjusted and merged in 5a4938c
Merge pull request #10 from EXreaction/ticket/10631
Fix for p-tags in INSTALL_CONGRATS_EXPLAIN
Merge pull request #10 from phpbb/ticket/security-171
[ticket/security-171] Use type cast helper for json data