Skip to content
Permalink
Browse files Browse the repository at this point in the history
[FIXED SECURITY-74] Apply markup formatter to remote cause note.
  • Loading branch information
jglick committed Feb 11, 2014
1 parent 0530a66 commit 5d57c85
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/src/main/java/hudson/model/Cause.java
Expand Up @@ -34,6 +34,7 @@
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;
import com.thoughtworks.xstream.converters.UnmarshallingContext;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
import javax.annotation.CheckForNull;
Expand Down Expand Up @@ -371,10 +372,13 @@ public RemoteCause(String host, String note) {
@Override
public String getShortDescription() {
if(note != null) {
return Messages.Cause_RemoteCause_ShortDescriptionWithNote(addr, note);
} else {
return Messages.Cause_RemoteCause_ShortDescription(addr);
try {
return Messages.Cause_RemoteCause_ShortDescriptionWithNote(addr, Jenkins.getInstance().getMarkupFormatter().translate(note));
} catch (IOException x) {
// ignore
}
}
return Messages.Cause_RemoteCause_ShortDescription(addr);
}

@Override
Expand Down

0 comments on commit 5d57c85

Please sign in to comment.