1
0
mirror of https://github.com/Mikaela/Limnoria.git synced 2025-04-09 09:28:12 +02:00

String: cap maximum soundex length to 1024.

This commit is contained in:
Daniel Folkinshteyn 2012-12-16 23:53:13 -05:00
parent 40bdec92ca
commit 5d6a3c5a46

@ -114,8 +114,11 @@ class String(callbacks.Plugin):
Returns the Soundex hash to a given length. The length defaults to
4, since that's the standard length for a soundex hash. For unlimited
length, use 0.
length, use 0. Maximum length 1024.
"""
if length > 1024:
irc.error("Maximum allowed length is 1024.")
return
irc.reply(utils.str.soundex(text, length))
soundex = wrap(soundex, ['somethingWithoutSpaces', additional('int', 4)])