You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2008/12/01 00:43:47 UTC

svn commit: r721932 - in /tomcat/tc6.0.x/trunk: ./ STATUS.txt java/org/apache/catalina/ssi/SSIServletExternalResolver.java webapps/docs/changelog.xml

Author: markt
Date: Sun Nov 30 15:43:47 2008
New Revision: 721932

URL: http://svn.apache.org/viewvc?rev=721932&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=42673
Correctly handle includes with multi-level contexts
Patch provided by Peter Jodeleit

Modified:
    tomcat/tc6.0.x/trunk/   (props changed)
    tomcat/tc6.0.x/trunk/STATUS.txt
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/ssi/SSIServletExternalResolver.java
    tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc6.0.x/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Nov 30 15:43:47 2008
@@ -1 +1 @@
-/tomcat/trunk:601180,606992,673796,673820,683982,684001,684081,684234,684269-684270,687503,687645,690781,691392,691805,692748,695053,695311,696780,696782,698012,698227,698236,698613,699427,699634,709294,709816,710063,710125,710205,711126,711600
+/tomcat/trunk:601180,606992,673796,673820,683982,684001,684081,684234,684269-684270,687503,687645,690781,691392,691805,692748,695053,695311,696780,696782,698012,698227,698236,698613,699427,699634,709294,709816,710063,710125,710205,711126,711600,712461

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=721932&r1=721931&r2=721932&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Sun Nov 30 15:43:47 2008
@@ -163,13 +163,6 @@
   +1: pero, fhanik, markt
   -1: 
 
-* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=42673
-  Correctly handle includes with multi-level contexts
-  Patch provided by Peter Jodeleit
-  http://svn.apache.org/viewvc?rev=712461&view=rev
-  +1: markt, fhanik, remm, pero
-  -1: 
-
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=42747
   Ensure context.xml takes effect on first deployment. Make processing of
   context.xml consistent.

Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/ssi/SSIServletExternalResolver.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/ssi/SSIServletExternalResolver.java?rev=721932&r1=721931&r2=721932&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/ssi/SSIServletExternalResolver.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/ssi/SSIServletExternalResolver.java Sun Nov 30 15:43:47 2008
@@ -353,14 +353,12 @@
     }
 
 
-    protected String getPathWithoutContext(String servletPath) {
-        String retVal = null;
-        int secondSlash = servletPath.indexOf('/', 1);
-        if (secondSlash >= 0) {
-            //cut off context
-            retVal = servletPath.substring(secondSlash);
+    protected String getPathWithoutContext(final String contextPath,
+            final String servletPath) {
+        if (servletPath.startsWith(contextPath)) {
+            return servletPath.substring(contextPath.length());
         }
-        return retVal;
+        return servletPath;
     }
 
 
@@ -419,7 +417,8 @@
                 // ie:
                 // '/file1.shtml' vs '/appName1/file1.shtml'
                 if (!isRootContext(normContext)) {
-                    String noContext = getPathWithoutContext(normalized);
+                    String noContext = getPathWithoutContext(
+                            normContext.getContextPath(), normalized);
                     if (noContext == null) {
                         throw new IOException(
                                 "Couldn't remove context from path: "

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=721932&r1=721931&r2=721932&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Sun Nov 30 15:43:47 2008
@@ -75,6 +75,10 @@
         headers. (markt)
       </fix>
       <fix>
+        <bug>42673</bug>: Fix SSI virtual includes for multi-level contexts.
+        Patch provided by Peter Jodeleit. (markt)
+      </fix>
+      <fix>
         <bug>43656</bug>: Correct regression in previous fix for this bug. Patch
         provided by Nils Eckert. (markt)
       </fix>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org