diff --git a/plugins/Moobot.py b/plugins/Moobot.py index 1b7c70230..79c127519 100644 --- a/plugins/Moobot.py +++ b/plugins/Moobot.py @@ -162,7 +162,7 @@ class Moobot(callbacks.Privmsg): """ text = privmsgs.getArgs(args) s = base64.encodestring(text).strip() - if ircutils.validArgument(s): + if ircutils.isValidArgument(s): irc.reply(msg, s) else: irc.error(msg, 'Base64 requires a newline in that string. '\ @@ -176,7 +176,7 @@ class Moobot(callbacks.Privmsg): """ text = privmsgs.getArgs(args) s = base64.decodestring(text) - if ircutils.validArgument(s): + if ircutils.isValidArgument(s): irc.reply(msg, s) else: irc.error(msg, 'I can\'t send \\n, \\r, or \\0.') diff --git a/src/ircutils.py b/src/ircutils.py index ae31d4d34..1efc50dee 100644 --- a/src/ircutils.py +++ b/src/ircutils.py @@ -157,12 +157,12 @@ def separateModes(args): def bold(s): return "\x02%s\x02" % s -def validArgument(s): +def isValidArgument(s): return '\r' not in s and '\n' not in s and '\x00' not in s notFunky = string.printable+'\x02' def safeArgument(s): - if validArgument(s) and s.translate(string.ascii, notFunky) == '': + if isValidArgument(s) and s.translate(string.ascii, notFunky) == '': return s else: return repr(s)