Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0f5768c

Browse files
committed
more and more fixes
1 parent 3759052 commit 0f5768c

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

lib/core/convert.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ def urlencode(string, safe=":/?%&=", convall=False):
9595
return result
9696

9797
if convall:
98-
result = urllib.quote(string)
98+
result = urllib.quote(string.encode("utf-8")) #Reference: http://old.nabble.com/Re:-Problem:-neither-urllib2.quote-nor-urllib.quote-encode-the--unicode-strings-arguments-p19823144.html
9999
else:
100-
result = urllib.quote(string, safe)
100+
result = urllib.quote(string.encode("utf-8"), safe)
101101

102102
return result
103103

lib/parse/configfile.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
with sqlmap; if not, write to the Free Software Foundation, Inc., 51
2222
Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2323
"""
24+
import codecs
2425

2526
from ConfigParser import NoSectionError
2627
from ConfigParser import RawConfigParser
2728

2829
from lib.core.common import checkFile
29-
from lib.core.convert import utf8decode
3030
from lib.core.data import conf
3131
from lib.core.data import logger
3232
from lib.core.exception import sqlmapMissingMandatoryOptionException
@@ -53,8 +53,6 @@ def configFileProxy(section, option, boolean=False, integer=False):
5353
value = False
5454
elif value in ("true", "True"):
5555
value = True
56-
else:
57-
value = utf8decode(value)
5856

5957
if value:
6058
conf[option] = value
@@ -79,7 +77,7 @@ def configFileParser(configFile):
7977

8078
checkFile(configFile)
8179
config = RawConfigParser()
82-
config.read(configFile)
80+
config.readfp(codecs.open(configFile, "r", "UTF8"))
8381

8482
if not config.has_section("Target"):
8583
raise NoSectionError, "Target in the configuration file is mandatory"

sqlmap.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ lastChar = 0
340340

341341
# SQL statement to be executed.
342342
# Example: SELECT 'foo', 'bar'
343-
query =
343+
query = INSERT INTO users VALUES (9, 'café', 'test')
344344

345345
# Prompt for an interactive SQL shell.
346346
# Valid: True or False

0 commit comments

Comments
 (0)