Revision 2198
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
88 | 88 |
|
89 | 89 |
##### Input validation |
90 | 90 |
|
91 |
def clean_name(name): return re.sub(r'\W', r'', name) |
|
91 |
def clean_name(name): return re.sub(r'\W', r'', name).lower()
|
|
92 | 92 |
|
93 | 93 |
def check_name(name): |
94 | 94 |
if re.search(r'\W', name) != None: raise NameException('Name "'+name |
Also available in: Unified diff
sql.py: clean_name(): Convert names to lowercase so that PostgreSQL will behave the same whether the name is escaped with "" or not. This will help avoid bugs in code that uses temp tables created by the sql module.