-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Input validering: Utvider regex som blir brukt ved inputvalidering i … (
#1391) Input validering: Utvider regex som blir brukt ved inputvalidering i saksbehandlingssystemet
- Loading branch information
1 parent
9b91496
commit da245d5
Showing
2 changed files
with
9 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,9 +44,11 @@ void skal_matche_adreser() { | |
} | ||
|
||
@Test | ||
void skal_ikke_tillate_diverse_som_adresse() { | ||
assertThat("<script type=js").doesNotMatch(ADRESSE); | ||
assertThat("\\u0013rf").doesNotMatch(ADRESSE); | ||
void skal_ikke_tillate_script_tegn_i_noen_av_regexene() { | ||
assertThat("<script type=js>").doesNotMatch(KODEVERK); | ||
assertThat("<script type=js>").doesNotMatch(NAVN); | ||
assertThat("<script type=js>").doesNotMatch(ADRESSE); | ||
assertThat("<script type=js>").doesNotMatch(FRITEKST); | ||
} | ||
|
||
@Test | ||
|
@@ -57,6 +59,7 @@ void skal_matche_fritekst() { | |
assertThat("Send svar til [email protected]").matches(FRITEKST); | ||
assertThat("Husk at 1+1=2").matches(FRITEKST); | ||
assertThat("&").matches(FRITEKST); | ||
assertThat("%§\\!?@_()+:;,=\"&\\p{Sc}").matches(FRITEKST); | ||
} | ||
|
||
@Test | ||
|