The login script was triggering a warning when unique names not in the database were requested. Since these values are coming in from userland, this could cause lots of unneccesary noise in the error logs. So, now the test is silent on failure, and initial checking to see if the string conforms to the unique name pattern is done as a cleanup rule so out-of-bounds strings are not even considered.
As part of this change I added two functions to function_libraries/util.php:
- reason_unique_name_valid_string(), which returns a boolean, and
- reason_unique_name_validate_string(), which returns the string if it matches the unique name pattern
I also cleaned up classes/disco.php so that its unique name validation uses standard tools rather than doing an independent query of the database.