@@ -667,15 +667,15 @@ def getGlob(irc, msg, args, state):
667667 glob = '*%s*' % glob
668668 state .args .append (glob )
669669
670- def _checkUrl (url ):
670+ def _checkUrl (state , url ):
671671 try :
672- args [ 0 ] .encode ('ascii' )
672+ url .encode ('ascii' )
673673 except UnicodeEncodeError :
674- state .errorInvalid (_ ('url' ), args [ 0 ] )
674+ state .errorInvalid (_ ('url' ), url )
675675
676676def getUrl (irc , msg , args , state ):
677677 if utils .web .urlRe .match (args [0 ]):
678- _checkUrl (args [0 ])
678+ _checkUrl (state , args [0 ])
679679 state .args .append (args .pop (0 ))
680680 else :
681681 state .errorInvalid (_ ('url' ), args [0 ])
@@ -694,10 +694,10 @@ def getEmail(irc, msg, args, state):
694694
695695def getHttpUrl (irc , msg , args , state ):
696696 if utils .web .httpUrlRe .match (args [0 ]):
697- _checkUrl (args [0 ])
697+ _checkUrl (state , args [0 ])
698698 state .args .append (args .pop (0 ))
699699 elif utils .web .httpUrlRe .match ('http://' + args [0 ]):
700- _checkUrl ('http://' + args [0 ])
700+ _checkUrl (state , 'http://' + args [0 ])
701701 state .args .append ('http://' + args .pop (0 ))
702702 else :
703703 state .errorInvalid (_ ('http url' ), args [0 ])
0 commit comments