summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNicolai Haehnle <nhaehnle@gmail.com>2007-03-25 22:03:12 +0200
committerNicolai Haehnle <nhaehnle@gmail.com>2007-03-25 22:03:12 +0200
commit63213fc4d5b37dda88d485383cc9e698244b5cdb (patch)
tree23a76e30829466e4987233169d6fcb42051b48c4 /framework
parentecf9baf56694e27dd10af46ec1867c6c327cce40 (diff)
Fix escaping
Diffstat (limited to 'framework')
-rw-r--r--framework/core.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/framework/core.py b/framework/core.py
index ede26d194..a83a92e49 100644
--- a/framework/core.py
+++ b/framework/core.py
@@ -80,10 +80,12 @@ def encode(text):
return r
def decode(text):
- # Unescape then reescape " and ' to make sure no unescaped
- # instances remain
+ # Unescape then reescape ", ' and \ to make sure no unescaped
+ # instances remain (that could break out of eval())
+ text = text.replace("\\\\", "\\")
text = text.replace("\\'", "'")
text = text.replace('\\"', '"')
+ text = text.replace("\\", "\\\\")
text = text.replace("'", "\\'")
text = text.replace('"', '\\"')
return eval('"' + text + '"')