Changeset 15051 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2019-05-05T17:35:29+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java
r15040 r15051 599 599 } 600 600 601 static String validateUploadTag(String uploadValue, String preferencePrefix, List<String> defMandatory, List<String> defForbidden) { 601 static String validateUploadTag(String uploadValue, String preferencePrefix, 602 List<String> defMandatory, List<String> defForbidden, List<String> defException) { 602 603 String uploadValueLc = lower(uploadValue); 603 604 // Check mandatory terms … … 608 609 } 609 610 // Check forbidden terms 611 List<String> exceptions = Config.getPref().getList(preferencePrefix+".exception-terms", defException); 610 612 List<String> forbiddenTerms = Config.getPref().getList(preferencePrefix+".forbidden-terms", defForbidden) 611 .stream().map(UploadAction::lower).filter(uploadValueLc::contains).collect(Collectors.toList()); 613 .stream().map(UploadAction::lower) 614 .filter(x -> uploadValueLc.contains(x) && !exceptions.stream().anyMatch(uploadValueLc::contains)) 615 .collect(Collectors.toList()); 612 616 if (!forbiddenTerms.isEmpty()) { 613 617 return tr("The following forbidden terms have been found: {0}", forbiddenTerms); … … 624 628 final String uploadComment = dialog.getUploadComment(); 625 629 final String uploadCommentRejection = validateUploadTag( 626 uploadComment, "upload.comment", def, def );630 uploadComment, "upload.comment", def, def, def); 627 631 if ((isUploadCommentTooShort(uploadComment) && warnUploadComment()) || 628 632 (uploadCommentRejection != null && warnRejectedUploadComment(uploadCommentRejection))) { … … 633 637 final String uploadSource = dialog.getUploadSource(); 634 638 final String uploadSourceRejection = validateUploadTag( 635 uploadSource, "upload.source", def, def );639 uploadSource, "upload.source", def, def, def); 636 640 if ((Utils.isStripEmpty(uploadSource) && warnUploadSource()) || 637 641 (uploadSourceRejection != null && warnRejectedUploadSource(uploadSourceRejection))) {
Note:
See TracChangeset
for help on using the changeset viewer.