Permalink
Browse files

Fixing crashing of the bot while using sskj keyword with special char…

…acters
  • Loading branch information...
1 parent b5c61f4 commit 68330a42df46b4f2134b9dfca103260e12a0456e @CrazyLemon CrazyLemon committed Sep 29, 2016
Showing with 1 addition and 1 deletion.
  1. +1 −1 scripts/servisi.coffee
View
@@ -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()

0 comments on commit 68330a4

Please sign in to comment.