Skip to content

Commit 50c5942

Browse files
committed
Consistently detect spring-beans.dtd reference in last path segment
Issue: SPR-13549 (cherry picked from commit 8b3b8d0)
1 parent fe36334 commit 50c5942

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-beans/src/main/java/org/springframework/beans/factory/xml/BeansDtdResolver.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ public InputSource resolveEntity(String publicId, String systemId) throws IOExce
5959
}
6060
if (systemId != null && systemId.endsWith(DTD_EXTENSION)) {
6161
int lastPathSeparator = systemId.lastIndexOf("/");
62-
int dtdNameStart = systemId.indexOf(DTD_NAME);
63-
if (dtdNameStart > lastPathSeparator) {
62+
int dtdNameStart = systemId.indexOf(DTD_NAME, lastPathSeparator);
63+
if (dtdNameStart != -1) {
6464
String dtdFile = DTD_FILENAME + DTD_EXTENSION;
6565
if (logger.isTraceEnabled()) {
6666
logger.trace("Trying to locate [" + dtdFile + "] in Spring jar on classpath");

0 commit comments

Comments
 (0)