public function checkQuery($query = null)
    {
        if ($query === null) {
            $query = $this->query;
        }

        if (strlen($query) == 0) {
            return true;
        }

        $pattern = "/^" . $this->regex["uric"] . "*$/";
        $status = @preg_match($pattern, $query);

        if ($status === false) {
            throw new Ts3Exception("URI query string validation failed");
        }

        return ($status == 1);
    }