This commit is contained in:
Miroslav Stampar 2016-01-08 11:47:12 +01:00
parent b427f6c03e
commit e3650342bd
2 changed files with 2 additions and 5 deletions

View File

@ -8,6 +8,7 @@ See the file 'doc/COPYING' for copying permission
import base64
import json
import pickle
import re
import StringIO
import sys
import types
@ -159,6 +160,7 @@ def htmlunescape(value):
if value and isinstance(value, basestring):
codes = (('&lt;', '<'), ('&gt;', '>'), ('&quot;', '"'), ('&nbsp;', ' '), ('&amp;', '&'))
retVal = reduce(lambda x, y: x.replace(y[0], y[1]), codes, retVal)
retVal = re.sub(r"&#x([^;]+);", lambda match: chr(int(match.group(1), 16)), retVal)
return retVal
def singleTimeWarnMessage(message): # Cross-linked function

View File

@ -197,11 +197,6 @@ def _oneShotErrorUse(expression, field=None, chunkTest=False):
_ = "%s(?P<result>.*?)%s" % (kb.chars.start, kb.chars.stop)
retVal = extractRegexResult(_, retVal, re.DOTALL | re.IGNORECASE) or retVal
try:
retVal = re.sub(r"&#x([^;]+);", lambda match: chr(int(match.group(1), 16)), retVal)
except ValueError:
pass
return safecharencode(retVal) if kb.safeCharEncode else retVal
def _errorFields(expression, expressionFields, expressionFieldsList, num=None, emptyFields=None, suppressOutput=False):