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

Function safeCSValue

lib/core/common.py:4469–4488  ·  view source on GitHub ↗

Returns value safe for CSV dumping # Reference: http://tools.ietf.org/html/rfc4180 >>> safeCSValue('foo, bar') '"foo, bar"' >>> safeCSValue('foobar') 'foobar'

(value)

Source from the content-addressed store, hash-verified

4467 raise SqlmapSyntaxException(errMsg)
4468
4469def safeCSValue(value):
4470 """
4471 Returns value safe for CSV dumping
4472
4473 # Reference: http://tools.ietf.org/html/rfc4180
4474
4475 >>> safeCSValue('foo, bar')
4476 '"foo, bar"'
4477 >>> safeCSValue('foobar')
4478 'foobar'
4479 """
4480
4481 retVal = value
4482
4483 if retVal and isinstance(retVal, six.string_types):
4484 if not (retVal[0] == retVal[-1] == '"'):
4485 if any(_ in retVal for _ in (conf.get("csvDel", defaults.csvDel), '"', '\n')):
4486 retVal = '"%s"' % retVal.replace('"', '""')
4487
4488 return retVal
4489
4490def filterPairValues(values):
4491 """

Callers 3

storeResultsToFileFunction · 0.90
_saveToResultsFileFunction · 0.90
dbTableValuesMethod · 0.90

Calls 2

getMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…