mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 09:36:35 +03:00
Fix for an Issue #513
This commit is contained in:
parent
7cb3ea20dd
commit
28eca2116f
|
@ -3365,6 +3365,27 @@ def checkDeprecatedOptions(args):
|
||||||
errMsg += " (hint: %s)" % DEPRECATED_OPTIONS[_]
|
errMsg += " (hint: %s)" % DEPRECATED_OPTIONS[_]
|
||||||
raise SqlmapSyntaxException(errMsg)
|
raise SqlmapSyntaxException(errMsg)
|
||||||
|
|
||||||
|
def checkSystemEncoding():
|
||||||
|
"""
|
||||||
|
Checks for problematic encodings
|
||||||
|
"""
|
||||||
|
|
||||||
|
if sys.getdefaultencoding() == "cp720":
|
||||||
|
try:
|
||||||
|
codecs.lookup("cp720")
|
||||||
|
except LookupError:
|
||||||
|
errMsg = "there is a known Python issue (#1616979) related "
|
||||||
|
errMsg += "to support for charset 'cp720'. Please visit "
|
||||||
|
errMsg += "'http://blog.oneortheother.info/tip/python-fix-cp720-encoding/index.html' "
|
||||||
|
errMsg += "and follow the instructions to be able to fix it"
|
||||||
|
logger.critical(errMsg)
|
||||||
|
|
||||||
|
warnMsg = "temporary switching to charset 'cp1256'"
|
||||||
|
logger.warn(warnMsg)
|
||||||
|
|
||||||
|
reload(sys)
|
||||||
|
sys.setdefaultencoding("cp1256")
|
||||||
|
|
||||||
def evaluateCode(code, variables=None):
|
def evaluateCode(code, variables=None):
|
||||||
"""
|
"""
|
||||||
Executes given python code given in a string form
|
Executes given python code given in a string form
|
||||||
|
|
|
@ -5,6 +5,7 @@ Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
|
||||||
See the file 'doc/COPYING' for copying permission
|
See the file 'doc/COPYING' for copying permission
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import codecs
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from optparse import OptionError
|
from optparse import OptionError
|
||||||
|
@ -13,6 +14,7 @@ from optparse import OptionParser
|
||||||
from optparse import SUPPRESS_HELP
|
from optparse import SUPPRESS_HELP
|
||||||
|
|
||||||
from lib.core.common import checkDeprecatedOptions
|
from lib.core.common import checkDeprecatedOptions
|
||||||
|
from lib.core.common import checkSystemEncoding
|
||||||
from lib.core.common import expandMnemonics
|
from lib.core.common import expandMnemonics
|
||||||
from lib.core.common import getUnicode
|
from lib.core.common import getUnicode
|
||||||
from lib.core.data import logger
|
from lib.core.data import logger
|
||||||
|
@ -28,6 +30,8 @@ def cmdLineParser():
|
||||||
This function parses the command line parameters and arguments
|
This function parses the command line parameters and arguments
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
checkSystemEncoding()
|
||||||
|
|
||||||
usage = "%s%s [options]" % ("python " if not IS_WIN else "", \
|
usage = "%s%s [options]" % ("python " if not IS_WIN else "", \
|
||||||
"\"%s\"" % sys.argv[0] if " " in sys.argv[0] else sys.argv[0])
|
"\"%s\"" % sys.argv[0] if " " in sys.argv[0] else sys.argv[0])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user