MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / escape

Method escape

plugins/dbms/cache/syntax.py:13–23  ·  view source on GitHub ↗

>>> from lib.core.common import Backend >>> Syntax.escape("SELECT 'abcdefgh' FROM foobar") == "SELECT CHAR(97)||CHAR(98)||CHAR(99)||CHAR(100)||CHAR(101)||CHAR(102)||CHAR(103)||CHAR(104) FROM foobar" True

(expression, quote=True)

Source from the content-addressed store, hash-verified

11class Syntax(GenericSyntax):
12 @staticmethod
13 def escape(expression, quote=True):
14 """
15 >>> from lib.core.common import Backend
16 >>> Syntax.escape("SELECT 'abcdefgh' FROM foobar") == "SELECT CHAR(97)||CHAR(98)||CHAR(99)||CHAR(100)||CHAR(101)||CHAR(102)||CHAR(103)||CHAR(104) FROM foobar"
17 True
18 """
19
20 def escaper(value):
21 return "||".join("CHAR(%d)" % _ for _ in getOrds(value))
22
23 return Syntax._escape(expression, quote, escaper)

Callers

nothing calls this directly

Calls 1

_escapeMethod · 0.80

Tested by

no test coverage detected