mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-06-30 01:43:22 +03:00
Minor bug fix to parse properly also unicode characters from configuration file
This commit is contained in:
parent
94354d0862
commit
7e78876f6a
|
@ -23,9 +23,10 @@ Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from ConfigParser import NoSectionError
|
from ConfigParser import NoSectionError
|
||||||
from ConfigParser import ConfigParser
|
from ConfigParser import RawConfigParser
|
||||||
|
|
||||||
from lib.core.common import checkFile
|
from lib.core.common import checkFile
|
||||||
|
from lib.core.convert import utf8decode
|
||||||
from lib.core.data import conf
|
from lib.core.data import conf
|
||||||
from lib.core.data import logger
|
from lib.core.data import logger
|
||||||
from lib.core.exception import sqlmapMissingMandatoryOptionException
|
from lib.core.exception import sqlmapMissingMandatoryOptionException
|
||||||
|
@ -48,12 +49,12 @@ def configFileProxy(section, option, boolean=False, integer=False):
|
||||||
value = None
|
value = None
|
||||||
elif value.isdigit():
|
elif value.isdigit():
|
||||||
value = int(value)
|
value = int(value)
|
||||||
elif value == "False":
|
elif value in ("false", "False"):
|
||||||
value = False
|
value = False
|
||||||
elif value == "True":
|
elif value in ("true", "True"):
|
||||||
value = True
|
value = True
|
||||||
|
else:
|
||||||
print option, value, type(value)
|
value = utf8decode(value)
|
||||||
|
|
||||||
if value:
|
if value:
|
||||||
conf[option] = value
|
conf[option] = value
|
||||||
|
@ -77,7 +78,7 @@ def configFileParser(configFile):
|
||||||
logger.debug(debugMsg)
|
logger.debug(debugMsg)
|
||||||
|
|
||||||
checkFile(configFile)
|
checkFile(configFile)
|
||||||
config = ConfigParser()
|
config = RawConfigParser()
|
||||||
config.read(configFile)
|
config.read(configFile)
|
||||||
|
|
||||||
if not config.has_section("Target"):
|
if not config.has_section("Target"):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user