Skip Navigation

Tweaks to login & unique name checking code

August 29, 2008 at 2:26 pm
By mryan

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:

  1. reason_unique_name_valid_string(), which returns a boolean, and
  2. 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.

Add a comment

Name*
Comment*
The following fields are not to be filled out. Skip to Submit Button.
Not Comment
(This is here to trap robots. Don't put any text here.)
Not URL
(This is here to trap robots. Don't put any text here.)
Avoid
(This is here to trap robots. Don't put any text here.)