-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Have a look at \controllers\dashboard.php :)
You're checking your input for validity by calling a function checkInputString(). Per intention your function SHOULD return just true or false (valid/ not valid), instead you're returning a string or null. A better way would be:
function isValidInput($input, ... ) {
if ($input_fails_your_condition) {
throw new Form_Validation_Exception('Something went horribly wrong!');
}
return true;
}
In your controller, you then just call your function within a try { ... } catch(Form_Validation_Exception $e) { ... }.
What's to learn here:
- be precise in your function declarations
- check for the correct return values (Duck-Typing is a bitch ;) )
- error/ exception handling should be concentrated at certain points (like your controller)
Happy coding! :)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request