@@ -110,7 +110,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
110110
111111 if partialValue :
112112 firstChar = len (partialValue )
113- elif "LENGTH(" in expression . upper () or " LEN(" in expression . upper ( ):
113+ elif re . search ( r"(?i)\b(LENGTH| LEN)\(" , expression ):
114114 firstChar = 0
115115 elif (kb .fileReadMode or dump ) and conf .firstChar is not None and (isinstance (conf .firstChar , int ) or (isinstance (conf .firstChar , basestring ) and conf .firstChar .isdigit ())):
116116 firstChar = int (conf .firstChar ) - 1
@@ -121,7 +121,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
121121 else :
122122 firstChar = 0
123123
124- if "LENGTH(" in expression . upper () or " LEN(" in expression . upper ( ):
124+ if re . search ( r"(?i)\b(LENGTH| LEN)\(" , expression ):
125125 lastChar = 0
126126 elif dump and conf .lastChar is not None and (isinstance (conf .lastChar , int ) or (isinstance (conf .lastChar , basestring ) and conf .lastChar .isdigit ())):
127127 lastChar = int (conf .lastChar )
@@ -343,15 +343,15 @@ def getChar(idx, charTbl=None, continuousOrder=True, expand=charsetType is None,
343343 if result :
344344 minValue = posValue
345345
346- if type (charTbl ) != xrange :
346+ if not isinstance (charTbl , xrange ) :
347347 charTbl = charTbl [position :]
348348 else :
349349 # xrange() - extended virtual charset used for memory/space optimization
350350 charTbl = xrange (charTbl [position ], charTbl [- 1 ] + 1 )
351351 else :
352352 maxValue = posValue
353353
354- if type (charTbl ) != xrange :
354+ if not isinstance (charTbl , xrange ) :
355355 charTbl = charTbl [:position ]
356356 else :
357357 charTbl = xrange (charTbl [0 ], charTbl [position ])
@@ -390,7 +390,7 @@ def getChar(idx, charTbl=None, continuousOrder=True, expand=charsetType is None,
390390 if timeBasedCompare :
391391 if kb .adjustTimeDelay is not ADJUST_TIME_DELAY .DISABLE :
392392 conf .timeSec += 1
393- warnMsg = "increasing time delay to %d second%s " % (conf .timeSec , 's' if conf .timeSec > 1 else '' )
393+ warnMsg = "increasing time delay to %d second%s" % (conf .timeSec , 's' if conf .timeSec > 1 else '' )
394394 logger .warn (warnMsg )
395395
396396 if kb .adjustTimeDelay is ADJUST_TIME_DELAY .YES :
0 commit comments