changeset 2052:d44efd32bc2f

core: line feed (\n) are now forbidden in profile names
author Goffi <goffi@goffi.org>
date Sun, 28 Aug 2016 20:09:09 +0200
parents 1dc3c7680ea0
children a3c2866841f7
files src/memory/memory.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/memory/memory.py	Sun Aug 28 19:42:48 2016 +0200
+++ b/src/memory/memory.py	Sun Aug 28 20:09:09 2016 +0200
@@ -461,9 +461,11 @@
         @return: Deferred
         """
         if not name:
-            raise ValueError("Empty profile name")
+            raise ValueError(u"Empty profile name")
         if name[0] == '@':
-            raise ValueError("A profile name can't start with a '@'")
+            raise ValueError(u"A profile name can't start with a '@'")
+        if '\n' in name:
+            raise ValueError(u"A profile name can't contain line feed ('\\n')")
 
         if name in self._entities_cache:
             raise exceptions.ConflictError(u"A session for this profile exists")