Permalink
Browse files

thou shalt not exploit %

git-svn-id: https://dev.upnl.org/svn/ircbot2/trunk@83 66f668a4-574d-4515-85ec-6e73d9c367eb
  • Loading branch information...
1 parent e49a77e commit 72b068ccf28caa81f03dafa662e49ecfff1fdb24 klutzy committed Apr 24, 2010
Showing with 4 additions and 4 deletions.
  1. +4 −4 plugins/mathnet.py
View
@@ -7,11 +7,11 @@ def search(eng):
"""mathnet에서 영어 to 한국어 용어를 검색."""
global con
pq = "select english, korean from mathnet where %s order by length(english) asc limit 3"
- q = pq % ("english = '%s'"%eng)
- f = con.execute(q).fetchall()
+ q = pq % ("english = '?'")
+ f = con.execute(q, (eng,)).fetchall()
if not f:
- q = pq % ("english like '%"+eng+"%'")
- f = con.execute(q).fetchall()
+ q = pq % ("english like '%?%'")
+ f = con.execute(q, (eng,)).fetchall()
return f
def on_pubmsg(bot, connection, event):

0 comments on commit 72b068c

Please sign in to comment.