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

View File

@ -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)])