hgweb: make PATH_INFO handling slightly more robust
authorMatt Mackall <mpm@selenic.com>
Thu, 12 Apr 2007 11:00:21 -0500
changeset 4339 26a2fa9433b8
parent 4334 66a3fe30f9fc
child 4342 9bfe93edfbb0
hgweb: make PATH_INFO handling slightly more robust
mercurial/hgweb/hgweb_mod.py
--- a/mercurial/hgweb/hgweb_mod.py	Tue Apr 10 12:24:28 2007 -0500
+++ b/mercurial/hgweb/hgweb_mod.py	Thu Apr 12 11:00:21 2007 -0500
@@ -716,7 +716,7 @@
                     # strip leading /
                     pi = pi[1:]
                     if pi:
-                        root = root[:-len(pi)]
+                        root = root[:root.rfind(root, pi)]
                     if req.env.has_key('REPO_NAME'):
                         rn = req.env['REPO_NAME'] + '/'
                         root += rn