View | Details | Raw Unified | Return to bug 329193
Collapse All | Expand All

(-)META-INF/MANIFEST.MF (-1 / +1 lines)
Lines 2-8 Link Here
2
Bundle-ManifestVersion: 2
2
Bundle-ManifestVersion: 2
3
Bundle-Name: %bundleName
3
Bundle-Name: %bundleName
4
Bundle-SymbolicName: org.eclipse.equinox.http.registry;singleton:=true
4
Bundle-SymbolicName: org.eclipse.equinox.http.registry;singleton:=true
5
Bundle-Version: 1.1.0.qualifier
5
Bundle-Version: 1.1.1.qualifier
6
Bundle-Activator: org.eclipse.equinox.http.registry.internal.Activator
6
Bundle-Activator: org.eclipse.equinox.http.registry.internal.Activator
7
Bundle-Localization: plugin
7
Bundle-Localization: plugin
8
Require-Bundle: org.eclipse.equinox.common,
8
Require-Bundle: org.eclipse.equinox.common,
(-)src/org/eclipse/equinox/http/registry/internal/DefaultRegistryHttpContext.java (-1 / +24 lines)
Lines 115-121 Link Here
115
			String path = resourceName.substring(0, lastSlash);
115
			String path = resourceName.substring(0, lastSlash);
116
			if (path.length() == 0)
116
			if (path.length() == 0)
117
				path = "/"; //$NON-NLS-1$
117
				path = "/"; //$NON-NLS-1$
118
			String file = resourceName.substring(lastSlash + 1);
118
			String file = sanitizeEntryName(resourceName.substring(lastSlash + 1));
119
			Enumeration entryPaths = bundle.findEntries(path, file, false);
119
			Enumeration entryPaths = bundle.findEntries(path, file, false);
120
120
121
			if (entryPaths != null && entryPaths.hasMoreElements())
121
			if (entryPaths != null && entryPaths.hasMoreElements())
Lines 124-129 Link Here
124
			return null;
124
			return null;
125
		}
125
		}
126
126
127
		private String sanitizeEntryName(String name) {
128
			StringBuffer buffer = null;
129
			for (int i = 0; i < name.length(); i++) {
130
				char c = name.charAt(i);
131
				switch (c) {
132
					case '*' :
133
					case '\\' :
134
						// we need to escape '*' and '\'
135
						if (buffer == null) {
136
							buffer = new StringBuffer(name.length() + 16);
137
							buffer.append(name.substring(0, i));
138
						}
139
						buffer.append('\\').append(c);
140
						break;
141
					default :
142
						if (buffer != null)
143
							buffer.append(c);
144
						break;
145
				}
146
			}
147
			return (buffer == null) ? name : buffer.toString();
148
		}
149
127
		public Set getResourcePaths(String path) {
150
		public Set getResourcePaths(String path) {
128
			if (bundlePath != null)
151
			if (bundlePath != null)
129
				path = bundlePath + path;
152
				path = bundlePath + path;
(-)META-INF/MANIFEST.MF (-1 / +1 lines)
Lines 4-10 Link Here
4
Bundle-Vendor: %providerName
4
Bundle-Vendor: %providerName
5
Bundle-Localization: plugin
5
Bundle-Localization: plugin
6
Bundle-SymbolicName: org.eclipse.equinox.jsp.jasper
6
Bundle-SymbolicName: org.eclipse.equinox.jsp.jasper
7
Bundle-Version: 1.0.200.qualifier
7
Bundle-Version: 1.0.201.qualifier
8
Bundle-Activator: org.eclipse.equinox.internal.jsp.jasper.Activator
8
Bundle-Activator: org.eclipse.equinox.internal.jsp.jasper.Activator
9
Import-Package: javax.servlet;version="[2.4, 3.0)",
9
Import-Package: javax.servlet;version="[2.4, 3.0)",
10
 javax.servlet.http;version="[2.4, 3.0)",
10
 javax.servlet.http;version="[2.4, 3.0)",
(-)src/org/eclipse/equinox/jsp/jasper/JspServlet.java (-1 / +24 lines)
Lines 168-174 Link Here
168
			String path = resourceName.substring(0, lastSlash);
168
			String path = resourceName.substring(0, lastSlash);
169
			if (path.length() == 0)
169
			if (path.length() == 0)
170
				path = "/"; //$NON-NLS-1$
170
				path = "/"; //$NON-NLS-1$
171
			String file = resourceName.substring(lastSlash + 1);
171
			String file = sanitizeEntryName(resourceName.substring(lastSlash + 1));
172
			Enumeration entryPaths = bundle.findEntries(path, file, false);
172
			Enumeration entryPaths = bundle.findEntries(path, file, false);
173
			if (entryPaths != null && entryPaths.hasMoreElements())
173
			if (entryPaths != null && entryPaths.hasMoreElements())
174
				return (URL) entryPaths.nextElement();
174
				return (URL) entryPaths.nextElement();
Lines 176-181 Link Here
176
			return delegate.getResource(name);
176
			return delegate.getResource(name);
177
		}
177
		}
178
178
179
		private String sanitizeEntryName(String name) {
180
			StringBuffer buffer = null;
181
			for (int i = 0; i < name.length(); i++) {
182
				char c = name.charAt(i);
183
				switch (c) {
184
					case '*' :
185
					case '\\' :
186
						// we need to escape '*' and '\'
187
						if (buffer == null) {
188
							buffer = new StringBuffer(name.length() + 16);
189
							buffer.append(name.substring(0, i));
190
						}
191
						buffer.append('\\').append(c);
192
						break;
193
					default :
194
						if (buffer != null)
195
							buffer.append(c);
196
						break;
197
				}
198
			}
199
			return (buffer == null) ? name : buffer.toString();
200
		}
201
179
		public InputStream getResourceAsStream(String name) {
202
		public InputStream getResourceAsStream(String name) {
180
			try {
203
			try {
181
				URL resourceURL = getResource(name);
204
				URL resourceURL = getResource(name);

Return to bug 329193