array( "regexp" => "^[^&=_'\-+;<>.]{1,18}$" )))) // { // return false; // } return true; } /** * If the password is longer than 100 characters, return false. Otherwise, return true. * * @param string password The password to validate. * * @return bool A boolean value. */ public function ValidatePassword(string $password) : bool{ if(strlen($password)>100) { return false; } return true; } /** * It checks if the length of the strings are less than 250 characters and if the resolution time * and points are positive * * @param string name The name of the enigma * @param string statement The statement of the enigma * @param string help Help text for the enigma * @param string reminder a reminder of the enigma * @param string example * @param string solution The solution to the enigma * @param string test the test to be run on the solution * @param string resolutionTime the time it takes to solve the enigma * @param int points * * @return bool a boolean value. */ public function ValidateEnigme(string $name,string $statement,string $help,string $reminder,string $example,string $solution,string $test, string $resolutionTime, int $points) : bool{ if(strlen($name)>50 || strlen($statement) > 250 || strlen($help) > 250 || strlen($reminder) > 250 || strlen($example) > 250 || strlen($solution) > 250 || strlen($test) > 250 || $resolutionTime < 0 || $points < 0) return false; return true; } }