~ubuntu-branches/ubuntu/saucy/jenkins/saucy

« back to all changes in this revision

Viewing changes to core/src/main/java/hudson/console/HyperlinkNote.java

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-01-10 09:50:50 UTC
  • mfrom: (5.1.10 experimental)
  • Revision ID: package-import@ubuntu.com-20130110095050-kj8xuw20gcfh62k3
Tags: 1.480.2+dfsg-1~exp1
* New upstream release (Closes: #696816, #697617):
  - d/control: Added new BD on libjbcrypt-java.
  - d/control: Versioned BD jenkins-winstone >= 0.9.10-jenkins-40.
  - d/control: Versioned BD jenkins-trilead-ssh2 >= 214-jenkins-1.
  - Fixes the following security vulnerabilities:
    CVE-2012-6072, CVE-2012-6073, CVE-2012-6072, CVE-2013-0158.
* Tidied lintian warnings.
* Bumped Standards-Version: 3.9.4, no changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
 *
37
37
 * @author Kohsuke Kawaguchi
38
38
 * @since 1.362
 
39
 * @see ModelHyperlinkNote
39
40
 */
40
41
public class HyperlinkNote extends ConsoleNote {
41
42
    /**
54
55
        String url = this.url;
55
56
        if (url.startsWith("/"))
56
57
            url = Jenkins.getInstance().getRootUrl()+url.substring(1);
57
 
        text.addHyperlink(charPos,charPos+length,url);
 
58
        text.addMarkup(charPos, charPos + length, "<a href='" + url + "'"+extraAttributes()+">", "</a>");
58
59
        return null;
59
60
    }
60
61
 
 
62
    protected String extraAttributes() {
 
63
        return "";
 
64
    }
 
65
 
61
66
    public static String encodeTo(String url, String text) {
62
67
        try {
63
68
            return new HyperlinkNote(url,text.length()).encode()+text;
69
74
    }
70
75
 
71
76
    @Extension
72
 
    public static final class DescriptorImpl extends ConsoleAnnotationDescriptor {
 
77
    public static class DescriptorImpl extends ConsoleAnnotationDescriptor {
73
78
        public String getDisplayName() {
74
79
            return "Hyperlinks";
75
80
        }