I think I found what I'm looking for but would like advise from experienced Joomla developers. I'm trying to filter my Usernames and Passwords the same way Joomla! is in a custom registration/login/authentication process that does not use JForm.
In the file: JoomlaRoot/libraries/joomla/filter/input.php
I found this function:
public function clean($source, $type = 'string')
Now the inline documentation says:
$source Input string/array-of-string to be 'cleaned'
$type Return type for the variable (INT, UINT, FLOAT, BOOLEAN, WORD, ALNUM, CMD, BASE64, STRING, ARRAY, PATH, NONE)
So I figured I was looking at a call to the function like this:
clean($Username,'STRING');
But as I looked deeper into the function I found a case that was missing from the documentation above, USERNAME.
case 'USERNAME':
$result = (string) preg_replace('/[\x00-\x1F\x7F<>"\'%&]/', '', $source);
break;
Is this what I'm looking for? If so what about the password? Are there any other filter or security functions being called that I should know about?
- Thank you.