1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

invalid URI supplied

Discussion in 'XenForo Development Discussions' started by silence, Aug 28, 2013.

  1. silence

    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!
     
  2. Daniel Hood

    Daniel Hood Well-Known Member

    It works as long as the parameter is a word with no symbols? Try urlencode()?
     
  3. silence

    silence Well-Known Member

    Yeah I figured that out yesterday. Should have responded to the thread! Thanks though!
     

Share This Page