Sanitize error message
This commit is contained in:
parent
3fd44a1813
commit
5ff22467a6
1 changed files with 2 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
import sys
|
||||
import os
|
||||
import cgi
|
||||
from Config import config
|
||||
|
||||
|
||||
|
@ -30,7 +31,7 @@ def formatException(err=None, format="text"):
|
|||
file = os.path.split(path)[1]
|
||||
tb.append("%s line %s" % (file, line))
|
||||
if format == "html":
|
||||
return "%s: %s<br><small>%s</small>" % (exc_type.__name__, err, " > ".join(tb))
|
||||
return "%s: %s<br><small>%s</small>" % (exc_type.__name__, cgi.escape(str(err)), " > ".join(tb))
|
||||
else:
|
||||
return "%s: %s in %s" % (exc_type.__name__, err, " > ".join(tb))
|
||||
|
||||
|
|
Loading…
Reference in a new issue