mirror of
				https://github.com/sqlmapproject/sqlmap.git
				synced 2025-10-26 05:31:04 +03:00 
			
		
		
		
	Implementing Issue #111
This commit is contained in:
		
							parent
							
								
									6809449e31
								
							
						
					
					
						commit
						ab9cb80602
					
				|  | @ -144,5 +144,4 @@ def htmlunescape(value): | ||||||
|     if value and isinstance(value, basestring): |     if value and isinstance(value, basestring): | ||||||
|         codes = (('<', '<'), ('>', '>'), ('"', '"'), (' ', ' '), ('&', '&')) |         codes = (('<', '<'), ('>', '>'), ('"', '"'), (' ', ' '), ('&', '&')) | ||||||
|         retVal = reduce(lambda x, y: x.replace(y[0], y[1]), codes, retVal) |         retVal = reduce(lambda x, y: x.replace(y[0], y[1]), codes, retVal) | ||||||
|         retVal = re.sub('&#(\d+);', lambda x: getUnicode(chr(x.group(1))), retVal) |  | ||||||
|     return retVal |     return retVal | ||||||
|  |  | ||||||
|  | @ -209,8 +209,10 @@ def decodePage(page, contentEncoding, contentType): | ||||||
|     else: |     else: | ||||||
|         kb.pageEncoding = conf.charset |         kb.pageEncoding = conf.charset | ||||||
| 
 | 
 | ||||||
|     if contentType and not isinstance(page, unicode) and any(map(lambda x: x in contentType.lower(), ("text/txt", "text/raw", "text/html", "text/xml"))): |  | ||||||
|     # can't do for all responses because we need to support binary files too |     # can't do for all responses because we need to support binary files too | ||||||
|  |     if contentType and not isinstance(page, unicode) and any(map(lambda x: x in contentType.lower(), ("text/txt", "text/raw", "text/html", "text/xml"))): | ||||||
|  |         if "&#" in page: | ||||||
|  |             page = re.sub('&#(\d+);', lambda _: chr(int(_.group(1))), page) | ||||||
|         kb.pageEncoding = kb.pageEncoding or checkCharEncoding(getHeuristicCharEncoding(page)) |         kb.pageEncoding = kb.pageEncoding or checkCharEncoding(getHeuristicCharEncoding(page)) | ||||||
|         page = getUnicode(page, kb.pageEncoding) |         page = getUnicode(page, kb.pageEncoding) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user