Pārlūkot izejas kodu

[fix] database: escape percent sign in strings

version-14
Cristi Harjoi pirms 9 gadiem
vecāks
revīzija
006a2a1754
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. +2
    -2
      frappe/database.py

+ 2
- 2
frappe/database.py Parādīt failu

@@ -785,7 +785,7 @@ class Database:
self._conn = None self._conn = None


def escape(self, s): def escape(self, s):
"""Excape quotes in given string."""
"""Excape quotes and percent in given string."""
if isinstance(s, unicode): if isinstance(s, unicode):
s = (s or "").encode("utf-8") s = (s or "").encode("utf-8")
return unicode(MySQLdb.escape_string(s), "utf-8")
return unicode(MySQLdb.escape_string(s), "utf-8").replace("%","%%")

Notiek ielāde…
Atcelt
Saglabāt