Skip to content

Commit b1cf577

Browse files
committed
SECURITY-2755
1 parent 28008e8 commit b1cf577

File tree

6 files changed

+34
-32
lines changed

6 files changed

+34
-32
lines changed

pom.xml

+17-15
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,38 @@
11
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2-
2+
33
<modelVersion>4.0.0</modelVersion>
4-
54
<parent>
65
<groupId>org.jenkins-ci.plugins</groupId>
76
<artifactId>plugin</artifactId>
8-
<version>1.541</version>
9-
</parent>
7+
<version>4.10</version>
8+
<relativePath />
9+
</parent>
10+
11+
<properties>
12+
<jenkins.version>2.222.1</jenkins.version>
13+
<java.level>8</java.level>
14+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
16+
</properties>
1017

1118
<artifactId>hidden-parameter</artifactId>
12-
<packaging>hpi</packaging>
19+
<packaging>hpi</packaging>
1320
<version>0.0.5-SNAPSHOT</version>
1421
<name>Hidden Parameter plugin</name>
1522
<url>http://wiki.jenkins-ci.org/display/JENKINS/Hidden+Parameter+Plugin</url>
16-
23+
1724
<organization>
1825
<name>wangyin</name>
1926
<url>www.wangyin.com</url>
2027
</organization>
21-
28+
2229
<developers>
2330
<developer>
2431
<id>wy-scm</id>
2532
<name>wy-scm</name>
2633
</developer>
2734
</developers>
2835

29-
3036
<build>
3137
<plugins>
3238
<plugin>
@@ -45,12 +51,12 @@
4551
</plugin>
4652
</plugins>
4753
</build>
48-
54+
4955
<scm>
5056
<connection>scm:git:git://github.com/jenkinsci/hidden-parameter-plugin.git</connection>
5157
<developerConnection>scm:git:[email protected]:jenkinsci/hidden-parameter-plugin.git</developerConnection>
5258
</scm>
53-
59+
5460
<repositories>
5561
<repository>
5662
<id>repo.jenkins-ci.org</id>
@@ -64,9 +70,5 @@
6470
<url>https://repo.jenkins-ci.org/public/</url>
6571
</pluginRepository>
6672
</pluginRepositories>
67-
68-
<properties>
69-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
70-
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
71-
</properties>
73+
7274
</project>

src/main/java/com/wangyin/parameter/WHideParameterDefinition.java

+6-9
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
import org.kohsuke.stapler.StaplerRequest;
1212

1313
/**
14-
* @author wy-scm <[email protected]>
15-
*
14+
* @author wy-scm [email protected]
15+
*
1616
*/
1717
public class WHideParameterDefinition extends ParameterDefinition {
1818

@@ -26,13 +26,13 @@ public String getDefaultValue() {
2626
public void setDefaultValue(String defaultValue) {
2727
this.defaultValue = defaultValue;
2828
}
29-
29+
3030
@DataBoundConstructor
3131
public WHideParameterDefinition(String name,String defaultValue, String description) {
3232
super(name, description);
3333
this.defaultValue = defaultValue;
3434
}
35-
35+
3636
@Extension
3737
public static class DescriptorImpl extends ParameterDescriptor {
3838
@Override
@@ -57,7 +57,7 @@ public ParameterValue createValue(StaplerRequest req) {
5757
throw new IllegalArgumentException("Illegal number of parameter values for " + getName() + ": " + value.length);
5858
} else {
5959
return new WHideParameterValue(getName(), value[0], getDescription());
60-
}
60+
}
6161
}
6262

6363

@@ -67,10 +67,7 @@ public ParameterValue createValue(StaplerRequest req, JSONObject jo) {
6767
return value;
6868
}
6969

70-
/**
71-
* @param args
72-
*/
73-
public static void main(String[] args) {
70+
public static void main(String[] args) {
7471

7572
}
7673

src/main/java/com/wangyin/parameter/WHideParameterValue.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
22
// Jad home page: http://www.kpdus.com/jad.html
3-
// Decompiler options: packimports(3)
3+
// Decompiler options: packimports(3)
44
// Source File Name: StringParameterValue.java
55

66
package com.wangyin.parameter;
@@ -10,10 +10,10 @@
1010
import org.kohsuke.stapler.DataBoundConstructor;
1111

1212
/**
13-
* @author wy-scm <[email protected]>
13+
* @author wy-scm [email protected]
1414
*/
1515
public class WHideParameterValue extends StringParameterValue {
16-
16+
1717
private static final long serialVersionUID = 6926027508686211675L;
1818

1919
@DataBoundConstructor
@@ -29,4 +29,4 @@ public WHideParameterValue(String name, String value, String description) {
2929
public String toString() {
3030
return "(HiddenParameterValue) " + getName() + "='" + value + "'";
3131
}
32-
}
32+
}

src/main/resources/com/wangyin/parameter/WHideParameterDefinition/config.jelly

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<!-- This jelly script is used for per-project configuration. See global.jelly
1+
<!-- This jelly script is used for per-project configuration. See global.jelly
22
for a general discussion about jelly script. -->
33

4-
<!-- Creates a text field that shows the value of the "name" property. When
4+
<!-- Creates a text field that shows the value of the "name" property. When
55
submitted, it will be passed to the corresponding constructor parameter. -->
6-
6+
<?jelly escape-by-default='true'?>
77
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define"
88
xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form"
99
xmlns:i="jelly:fmt" xmlns:p="/lib/hudson/project">

src/main/resources/com/wangyin/parameter/WHideParameterDefinition/index.jelly

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<?jelly escape-by-default='true'?>
12
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define"
23
xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form"
34
xmlns:i="jelly:fmt" xmlns:p="/lib/hudson/project">
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
<?jelly escape-by-default='true'?>
12
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define"
23
xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form"
34
xmlns:i="jelly:fmt" xmlns:p="/lib/hudson/project">
4-
<f:entry title="${it.name}" description="${it.description}">
5+
<j:set var="escapeEntryTitleAndDescription" value="false"/>
6+
<f:entry title="${h.escape(it.name)}" description="${it.formattedDescription}">
57
<f:textbox name="value" value="${it.value}" readonly="true" />
68
</f:entry>
79
</j:jelly>

0 commit comments

Comments
 (0)