Revision 2396
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
100 | 100 |
|
101 | 101 |
##### Input validation |
102 | 102 |
|
103 |
def clean_name(name): return re.sub(r'\W', r'', name.replace('.', '_')) |
|
104 |
|
|
103 | 105 |
def check_name(name): |
104 | 106 |
if re.search(r'\W', name) != None: raise NameException('Name "'+name |
105 | 107 |
+'" may contain only alphanumeric characters and _') |
Also available in: Unified diff
sql.py: Added clean_name()