Permalink
Browse files

fix array out of bounds in YJsonResponseWriter and OpensearchResponsW…

…riter

on recreation of image url. 
Set parameter of indexList2protocolList to required number of images (image_stubs)
Situation e.g. image_stub(size=15) but images_protocol(size=12)
  • Loading branch information...
reger24 committed Oct 2, 2017
1 parent cbaa492 commit ae1c675c854fe2b8a928e6762cdba5ca74d22b32
@@ -248,7 +248,7 @@ public void write(final Writer writer, final SolrQueryRequest request, final Sol
}
if (Math.min(images_protocol_obj.size(), images_stub.size()) > 0) {
List<String> images_protocol = CollectionConfiguration.indexedList2protocolList(images_protocol_obj, images_protocol_obj.size());
List<String> images_protocol = CollectionConfiguration.indexedList2protocolList(images_protocol_obj, images_stub.size());
String imageurl = images_protocol.get(0) + "://" + images_stub.get(0);
writer.write("<media:content medium=\"image\" url=\"");
XML.escapeCharData(imageurl, writer); writer.write("\"/>\n");
@@ -216,7 +216,7 @@ public void write(final Writer writer, final SolrQueryRequest request, final Sol
}
if (Math.min(images_protocol_obj.size(), images_stub.size()) > 0) {
List<String> images_protocol = CollectionConfiguration.indexedList2protocolList(images_protocol_obj, images_protocol_obj.size());
List<String> images_protocol = CollectionConfiguration.indexedList2protocolList(images_protocol_obj, images_stub.size());
String imageurl = images_protocol.get(0) + "://" + images_stub.get(0);
solitaireTag(writer, "image", imageurl);
} else {

0 comments on commit ae1c675

Please sign in to comment.