Improved security of "sendRequest" method

This commit is contained in:
Pierre
2017-12-24 16:48:08 +01:00
parent e8b448ea86
commit bdf47b9c26
3 changed files with 23 additions and 1 deletions

View File

@ -119,4 +119,18 @@ function safe_for_sql(string $input) : string {
return $input;
}
/**
* Check a given user ID
*
* @param int $userID The user ID to check
* @return bool True if userID is valid, false else
*/
function check_user_id(int $userID) : bool {
if($userID < 1)
return false; //Invalid
return true; //Valid
}