WildPHP / irc-bot

A simple and modular PHP IRC bot
MIT License
84 stars 24 forks source link

Fatal error: str_split() expects parameter 1 to be string, null given #162

Closed ivptr closed 3 years ago

ivptr commented 3 years ago
wildphp.DEBUG: << :irc.example.org 001 TestBot :Welcome to the ExampleNET IRC Network TestBot!TestBot@localhost [] []
wildphp.DEBUG: Created initial user; my job is done {"id":1,"nickname":"TestBot"} []
wildphp.DEBUG: Queued initial channel join. {"count":1,"channels":["#testbot"]} []
wildphp.DEBUG: << :irc.example.org 002 TestBot :Your host is irc.example.org, running version UnrealIRCd-5.0.5.1 [] []
wildphp.DEBUG: << :irc.example.org 003 TestBot :This server was created Fri May 29 09:07:59 2020 [] []
wildphp.DEBUG: << :irc.example.org 004 TestBot irc.example.org UnrealIRCd-5.0.5.1 iowrsxzdHtIDZRqpWGTSB lvhopsmntikraqbeIHzMQNRTOVKDdGLPZSCcf [] []

Notice: Undefined offset: 5 in vendor\wildphp\irc-messages\src\RPL\MyInfo.php on line 61

Fatal error: Uncaught TypeError: str_split() expects parameter 1 to be string, null given in vendor\wildphp\irc-messages\src\RPL\MyInfo.php:69
Stack trace:
#0 vendor\wildphp\irc-messages\src\RPL\MyInfo.php(69): str_split(NULL)
#1 vendor\wildphp\irc-messages\src\Utility\MessageCaster.php(52): WildPHP\Messages\RPL\MyInfo::fromIncomingMessage(Object(WildPHP\Messages\Generics\IrcMessage))
#2 src\Connection\IncomingMessageParser.php(68): WildPHP\Messages\Utility\MessageCaster::castMessage(Object(WildPHP\Messages\Generics\IrcMessage))
#3 vendor\evenement\evenement\src\Evenement\EventEmitterTrait.php(123): WildPHP\Core\Connection\IncomingMessageParser->parseIncomingIrcLine(':irc.example.or...')
#4 src\Connection\IncomingMessageParser.php(99): Evenement\EventEmitter->emit('stream.line.in', Array)
#5 vendor\evenement\evenement\src\Evenement\EventEmitterTrait.php(123): WildPHP\Core\Connection\I in vendor\wildphp\irc-messages\src\RPL\MyInfo.php on line 69
NanoSector commented 3 years ago

The messages library expects a fifth parameter for channel modes with a parameter, but this is not required to be set according to the protocol specification. The server I have tested against does send this so this is why this slipped through testing.

ivptr commented 3 years ago

Since it is pulling the old version 0.3 of irc-messages instead of 0.3.1, it behaves like this is not fixed: "wildphp/irc-messages": "^0.3",

NanoSector commented 3 years ago

Dependabot already opened a PR for that it seems; I'll merge that. That should fix this issue.