One of breitenfelds's isinstance() patches was wrong.
authorEric S. Raymond <esr@thyrsus.com>
Thu, 4 Oct 2012 04:47:28 +0000 (00:47 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 4 Oct 2012 04:47:28 +0000 (00:47 -0400)
irkerd

diff --git a/irkerd b/irkerd
index 1e11343df46afd9816e4a3d87be411dabf19ceb7..2567ccd804b75c7ff7aed0b95e991f6ec2725063 100755 (executable)
--- a/irkerd
+++ b/irkerd
@@ -391,14 +391,14 @@ class Irker:
                 channels = request['to']
                 message = request['privmsg']
                 if not isinstance(channels, (list, unicode)) \
-                       or not isinstance(message, unicode):
+                       and not isinstance(message, unicode):
                     self.logerr("malformed request - unexpected types: %r" % request)
                 else:
                     if isinstance(channels, unicode):
                         channels = [channels]
                     for url in channels:
-                        if not isinstance(url, unicode):
-                            self.logerr("malformed request - unexpected type: %r" % request)
+                        if not type(url) in (type(""), type(u"")): 
+                            self.logerr("malformed request - URL has unexpected type: %r" % url)
                         else:
                             target = Target(url)
                             if not target.valid():