Commit b812c045 authored by 's avatar

Made unpickling more paranoid

parent d4e37131
"""Copy interface"""
__version__='$Revision: 1.3 $'[11:-2]
__version__='$Revision: 1.4 $'[11:-2]
import Globals, Moniker, rPickle
from cPickle import loads, dumps
......@@ -24,6 +24,8 @@ class CopyContainer:
def validClipData(self):
# Return true if clipboard data is valid.
moniker=rPickle.loads(unquote(self.REQUEST['clip_data']))
try: moniker=rPickle.loads(unquote(self.REQUEST['clip_data']))
except: return 0
v=self.REQUEST['validClipData']=moniker.assert()
......@@ -68,7 +70,7 @@ class CopySource:
def _getCopy(self, container):
# Ask an object for a new copy of itself.
return loads(dumps(self))
return loads(dumps(self,1))
def _postCopy(self, container):
# Called after the copy is finished to accomodate special cases
......@@ -84,7 +86,7 @@ class CopySource:
try: moniker=self._getMoniker()
except: return eNotSupported
REQUEST['RESPONSE'].setCookie('clip_data',
quote(dumps(moniker)),
quote(dumps(moniker,1)),
path='%s' % REQUEST['SCRIPT_NAME'])
......
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