Skip to content

Commit

Permalink
Fixing crashing of the bot while using sskj keyword with special char…
Browse files Browse the repository at this point in the history
…acters
  • Loading branch information
CrazyLemon committed Sep 29, 2016
1 parent b5c61f4 commit 68330a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/servisi.coffee
Expand Up @@ -140,7 +140,7 @@ module.exports = (bot) ->
".sskj <niz> -- išče <niz> v SSKJ in izpiše prvo ujemanje",
(match, r) ->
f = match[1].trim().replace(" ","+")
url = "http://bos.zrc-sazu.si/cgi/a03.exe?name=sskj_testa&expression=#{f}"
url = "http://bos.zrc-sazu.si/cgi/a03.exe?name=sskj_testa&expression=#{encodeURI(f)}"
bot.fetchHTML url, ($) ->
if $? && $("h2").text().indexOf("Zadetkov ni bilo:") == -1
result = $(".nounderline").eq(0).text()
Expand Down

0 comments on commit 68330a4

Please sign in to comment.