aboutsummaryrefslogtreecommitdiff
path: root/id/ConfigWebTool/src/main/java
diff options
context:
space:
mode:
authorBojan Suzic <bojan.suzic@iaik.tugraz.at>2014-02-20 14:52:43 +0100
committerBojan Suzic <bojan.suzic@iaik.tugraz.at>2014-02-20 14:52:43 +0100
commit30f0d319f34d7fb13de2d1c7c6a72cdc918c335b (patch)
tree751ff6eb5990d4309d37d2ae14978bf9d3f2d221 /id/ConfigWebTool/src/main/java
parent51e9d604381d6be35bbe2dd0df9cb75af3152d96 (diff)
parent86306b3ddfe33fd4fc7fde85b44add472729914e (diff)
downloadmoa-id-spss-30f0d319f34d7fb13de2d1c7c6a72cdc918c335b.tar.gz
moa-id-spss-30f0d319f34d7fb13de2d1c7c6a72cdc918c335b.tar.bz2
moa-id-spss-30f0d319f34d7fb13de2d1c7c6a72cdc918c335b.zip
Merge branch 'moa2_0_tlenz' of gitlab.iaik.tugraz.at:afitzek/moa-idspss into moa2_0_tlenz_bs_2
Diffstat (limited to 'id/ConfigWebTool/src/main/java')
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/StorkConfigValidator.java59
1 files changed, 31 insertions, 28 deletions
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/StorkConfigValidator.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/StorkConfigValidator.java
index 318b3b3e7..d8b0ac6de 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/StorkConfigValidator.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/StorkConfigValidator.java
@@ -22,37 +22,40 @@ public class StorkConfigValidator {
log.debug("Validate general STORK configuration");
// check peps list
- for(CPEPS current : form.getCpepslist()) {
- // check country code
- String check = current.getCountryCode();
- if (MiscUtil.isNotEmpty(check)) {
- if (ValidationHelper.containsPotentialCSSCharacter(check, false)) {
- log.warn("CPEPS config countrycode contains potentail XSS characters: " + check);
- errors.add(LanguageHelper.getErrorString("validation.stork.cpeps.cc",
- new Object[] {ValidationHelper.getPotentialCSSCharacter(false)} ));
- }
- if(!check.toLowerCase().matches("^[a-z][a-z]$")) {
- log.warn("CPEPS config countrycode does not comply to ISO 3166-2 : " + check);
+
+ if (form.getCpepslist() != null) {
+ for(CPEPS current : form.getCpepslist()) {
+ // check country code
+ String check = current.getCountryCode();
+ if (MiscUtil.isNotEmpty(check)) {
+ if (ValidationHelper.containsPotentialCSSCharacter(check, false)) {
+ log.warn("CPEPS config countrycode contains potentail XSS characters: " + check);
errors.add(LanguageHelper.getErrorString("validation.stork.cpeps.cc",
- new Object[] {check} ));
+ new Object[] {ValidationHelper.getPotentialCSSCharacter(false)} ));
+ }
+ if(!check.toLowerCase().matches("^[a-z][a-z]$")) {
+ log.warn("CPEPS config countrycode does not comply to ISO 3166-2 : " + check);
+ errors.add(LanguageHelper.getErrorString("validation.stork.cpeps.cc",
+ new Object[] {check} ));
+ }
+ } else {
+ log.warn("CPEPS config countrycode is empty : " + check);
+ errors.add(LanguageHelper.getErrorString("validation.stork.cpeps.empty",
+ new Object[] {check} ));
}
- } else {
- log.warn("CPEPS config countrycode is empty : " + check);
- errors.add(LanguageHelper.getErrorString("validation.stork.cpeps.empty",
- new Object[] {check} ));
- }
-
- // check url
- check = current.getURL();
- if (MiscUtil.isNotEmpty(check)) {
- if (!ValidationHelper.validateURL(check)) {
- log.info("CPEPS config URL is invalid : " + check);
- errors.add(LanguageHelper.getErrorString("validation.stork.cpeps.url"));
+
+ // check url
+ check = current.getURL();
+ if (MiscUtil.isNotEmpty(check)) {
+ if (!ValidationHelper.validateURL(check)) {
+ log.info("CPEPS config URL is invalid : " + check);
+ errors.add(LanguageHelper.getErrorString("validation.stork.cpeps.url"));
+ }
+ } else {
+ log.warn("CPEPS config url is empty : " + check);
+ errors.add(LanguageHelper.getErrorString("validation.stork.cpeps.empty",
+ new Object[] {check} ));
}
- } else {
- log.warn("CPEPS config url is empty : " + check);
- errors.add(LanguageHelper.getErrorString("validation.stork.cpeps.empty",
- new Object[] {check} ));
}
}