public function forceSiteUrl(&$options, $site)
    {
        if (!$site instanceof Site) {
            $site = $this->storage->findOne($site);
        }

        if ($GLOBALS['is_https']) {
            $options['https'] = !$site->isHttpsAllowed();
        } else if (variable_get('https', false)) {
            $options['https'] = !$site->isHttpAllowed();
        } else {
            // Sorry, HTTPS is disabled at the Drupal level, note that it is not
            // mandatory to this because url() will do the check by itself, but
            // because there is in here one code path in which we are going to
            // manually set the base URL, we need to compute that by ourselves.
            $options['https'] = false;
        }

        // Warning, this is a INTERNAL url() function behavior, so we have
        // to reproduce a few other behaviours to go along with it, such as
        // manual http vs https handling. Please see the variable_get('https')
        // documentation above.
        $options['base_url'] = ($options['https'] ? 'https://' : 'http://') . $site->getHostname();
        $options['absolute'] = true;
    }