Austinb / GameQ

A PHP Gameserver Status Query Library
https://austinb.github.io/GameQ/
GNU Lesser General Public License v3.0
403 stars 134 forks source link

Teamspeak 3 issue when empty channel topic #36

Closed Austinb closed 12 years ago

Austinb commented 12 years ago

Get a notice for undef offset from the explode at line 357

PHP Notice: Undefined offset: 1 in GameQ/gameq/protocols/teamspeak3.php on line 357

xFlip commented 12 years ago

Hi, i was now able to fix it.

I found the PHP functiton "array_pad" which ensures that a value is given.

Replace the line 354 with this: list($key, $value) = array_pad(explode('=', $variable, 2), 2, null);

So if the value is empty, array_pad will add the value "null". Its also possible to set it "" or something else.

I hope that i helped you!