Skip to content

Commit

Permalink
Sanitize paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas committed Aug 30, 2017
1 parent 3b0bf3c commit 38443c3
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void index(final String seItemId, final String seItemName, final Map<Stri
// metadata
streamUpdate.setParam(toParam(Search.Fields.REPOSITORY), repository);
streamUpdate.setParam(toParam(Search.Fields.COMMITID), commitId);
streamUpdate.setParam(toParam(Search.Fields.SEITEM_ID), seItemId);
streamUpdate.setParam(toParam(Search.Fields.SEITEM_ID), sanitizePath(seItemId));
streamUpdate.setParam(toParam(Search.Fields.SEITEM_NAME), seItemName);
addMetadata(streamUpdate, metadata);
// content
Expand Down Expand Up @@ -141,4 +141,8 @@ private String toFieldName(String fieldName) {
return fieldName.trim().replace(" ", "_").toLowerCase();
}

private String sanitizePath(String path) {
return path.replace("\\", "/");
}

}

0 comments on commit 38443c3

Please sign in to comment.