Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Jing Xu committed Sep 25, 2023
1 parent ef6c173 commit 1f19d01
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Validation/RequestValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ public function validateRequestData(
$requestBody = $request->getParsedBody() ?? [];
$validator = new Validator();

// Register NoHtmlTag rule and set it's exception into BadRequestContainHTMLTagsException
if (in_array(NoHtmlTag::NO_HTML_TAG_RULE, $validationRules)) {
$validator->addValidator(NoHtmlTag::NO_HTML_TAG_RULE, new NoHtmlTag());
$exceptions[NoHtmlTag::NO_HTML_TAG_RULE] = BadRequestContainHTMLTagsException::class;
}
// add custom validators
$validator->addValidator(NoHtmlTag::NO_HTML_TAG_RULE, new NoHtmlTag());

// add custom exceptions
$exceptions[NoHtmlTag::NO_HTML_TAG_RULE] = BadRequestContainHTMLTagsException::class;

// Add custom validation rules
if (!empty($customRules)) {
Expand Down

0 comments on commit 1f19d01

Please sign in to comment.