Browse Source

Avoid infinite loop if SxImport returns no Result #233363

userinfo_gueltigkeit
Daniel Quathamer 11 months ago
parent
commit
b6aebbc415
  1. 10
      src/de/superx/servlet/SxPool.java

10
src/de/superx/servlet/SxPool.java

@ -1552,10 +1552,18 @@ public class SxPool extends GenericObjectPool implements NamedObjectI { @@ -1552,10 +1552,18 @@ public class SxPool extends GenericObjectPool implements NamedObjectI {
String importInstruction = work.substring(posstart + 10, posende );
ResultSet rs = stm.executeQuery(importInstruction);
boolean validReplaceText=false;
while (rs.next()) {
StringUtils.replace(work, "<sximport>" + importInstruction + "</sximport>", rs.getString(1));
validReplaceText=true;
String replaceText=rs.getString(1);
if(replaceText==null)
StringUtils.replace(work, "<sximport>" + importInstruction + "</sximport>", "");
else
StringUtils.replace(work, "<sximport>" + importInstruction + "</sximport>", replaceText);
}
rs.close();
if(!validReplaceText)
break;
}
stm.close();
dbConnection.close();

Loading…
Cancel
Save