quote Pattern for thumbnail resolution constructed from bitstream filename

This commit is contained in:
Gantner, Florian Klaus
2023-10-10 16:19:11 +02:00
parent 92844f0b05
commit a124807468
2 changed files with 48 additions and 1 deletions

View File

@@ -403,7 +403,7 @@ public class BitstreamServiceImpl extends DSpaceObjectServiceImpl<Bitstream> imp
@Override
public Bitstream getThumbnail(Context context, Bitstream bitstream) throws SQLException {
Pattern pattern = Pattern.compile("^" + bitstream.getName() + ".([^.]+)$");
Pattern pattern = Pattern.compile("^" + Pattern.quote(bitstream.getName()) + ".([^.]+)$");
for (Bundle bundle : bitstream.getBundles()) {
for (Item item : bundle.getItems()) {