Selaa lähdekoodia

[fix] database: escape percent sign in strings

version-14
Cristi Harjoi 9 vuotta sitten
vanhempi
commit
006a2a1754
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. +2
    -2
      frappe/database.py

+ 2
- 2
frappe/database.py Näytä tiedosto

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

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

Ladataan…
Peruuta
Tallenna