invalid URI supplied

silence

Well-known member
Ok so I'm new to this whole CONSTRUCTOR business, but I think I figured it out. Everything works accept one thing: I cannot pass a parameter to the constructor that contains like a slash or space or w/e.

Here is the constructor: (Teamspeak_Helper_Query)

PHP:
    protected $instance = NULL;

    public function _getInstance()
    {
        return $this->instance;
    }

    public function __construct($nickname = NULL)
    {
        $serverinfo = array(
            'serverip' => XenForo_Application::get('options')->teamspeak_serverip,
            'udp' => XenForo_Application::get('options')->teamspeak_udp,
            'tcp' => XenForo_Application::get('options')->teamspeak_query,
            'user' => XenForo_Application::get('options')->teamspeak_queryuser,
            'password' => XenForo_Application::get('options')->teamspeak_querypassword,
        );

        if ($nickname == NULL)
        {
            $nickname = mt_rand();
        }

        if ($this->instance == NULL)
        {
            $this->instance = TeamSpeak3::factory("serverquery://" . $serverinfo['user'] . ":" . $serverinfo['password'] . "@" . $serverinfo['serverip'] . ":" . $serverinfo['tcp'] . "/?server_port=" . $serverinfo['udp'] . "&nickname=" . $nickname . "&use_offline_as_virtual=1&no_query_clients=1");
        }
    }

And here is where it's getting called. Teamspeak_Helper_Alert extends Teamspeak_Helper_Query so it all works out dandy :3
PHP:
                // $teamspeak = new Teamspeak_Helper_Alert($data['username'] . "'s Bot");

So there isn't much help I can find since nobody else get's this sorta error!
Thanks!
 
Top Bottom