Commit d96eb230 authored by Martijn Pieters's avatar Martijn Pieters

Fix setVirtualRoot in the face of unicode paths (such as occur during an

XML-RPC request.
parent 6fc1aa9f
...@@ -11,9 +11,10 @@ ...@@ -11,9 +11,10 @@
# #
############################################################################## ##############################################################################
__version__='$Revision: 1.82 $'[11:-2] __version__='$Revision: 1.83 $'[11:-2]
import re, sys, os, urllib, time, random, cgi, codecs import re, sys, os, urllib, time, random, cgi, codecs
from types import StringType, UnicodeType
from BaseRequest import BaseRequest from BaseRequest import BaseRequest
from HTTPResponse import HTTPResponse from HTTPResponse import HTTPResponse
from cgi import FieldStorage, escape from cgi import FieldStorage, escape
...@@ -162,8 +163,8 @@ class HTTPRequest(BaseRequest): ...@@ -162,8 +163,8 @@ class HTTPRequest(BaseRequest):
def setVirtualRoot(self, path, hard=0): def setVirtualRoot(self, path, hard=0):
""" Treat the current publishing object as a VirtualRoot """ """ Treat the current publishing object as a VirtualRoot """
other = self.other other = self.other
if type(path) is type(''): if isinstance(path, StringType) or isinstance(path, UnicodeType):
path = path.split( '/') path = path.split('/')
self._script[:] = map(quote, filter(None, path)) self._script[:] = map(quote, filter(None, path))
del self._steps[:] del self._steps[:]
parents = other['PARENTS'] parents = other['PARENTS']
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment