Improve sanitizers for mails, urls
This commit is contained in:
parent
f478728ab9
commit
b16a6762e4
@ -148,7 +148,7 @@ final class MD_STD_IN {
|
|||||||
if ($input === "") return "";
|
if ($input === "") return "";
|
||||||
|
|
||||||
$output = \filter_var($input, FILTER_SANITIZE_URL);
|
$output = \filter_var($input, FILTER_SANITIZE_URL);
|
||||||
if (\filter_var($output, FILTER_VALIDATE_URL) === false) {
|
if (($output = \filter_var($output, FILTER_VALIDATE_URL)) === false) {
|
||||||
throw new MDInvalidUrl("Invalid input URL");
|
throw new MDInvalidUrl("Invalid input URL");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,7 +168,7 @@ final class MD_STD_IN {
|
|||||||
if ($input === "") return "";
|
if ($input === "") return "";
|
||||||
|
|
||||||
$output = \filter_var($input, FILTER_SANITIZE_EMAIL);
|
$output = \filter_var($input, FILTER_SANITIZE_EMAIL);
|
||||||
if (\filter_var($output, FILTER_VALIDATE_EMAIL) === false) {
|
if (($output = \filter_var($output, FILTER_VALIDATE_EMAIL)) === false) {
|
||||||
throw new MDInvalidEmail("Invalid input email address");
|
throw new MDInvalidEmail("Invalid input email address");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user