public static function query_string($request = null)
    {
        if (!$request) {
            $request = Controller::curr()->Request;
        }

        if (!$request) {
            return '';
        }

        $vars = $request->getVars();
        if (isset($vars['url'])) {
            unset($vars['url']);
        }

        return empty($vars) ? '' : '?' . http_build_query($vars);
    }