There is a logic error in domain_init() that causes content sent to all affiliates not to display properly.

The existing code is:

function domain_init() {
  global $_domain;
  $_domain = array();

  // Grant access to all affiliates.
  $_domain['site_grant'] = DOMAIN_SITE_GRANT;

  // Cribbed from bootstrap.inc -- removes port protocols from the host value.
  $_subdomain = implode('.', array_reverse(explode(':', rtrim($_SERVER['HTTP_HOST'], '.'))));

  // Lookup the active domain against our allowed hosts record.
  $_domain = db_fetch_array(db_query("SELECT domain_id, subdomain, sitename FROM {domain} WHERE subdomain = '%s'", $_subdomain));

  // If empty, then the DNS didn't match anything, so use defaults.
  if (empty($_domain['domain_id'])) {
    $_domain = domain_default();
  }
}

This function causes the site_grant to be unset. The correct function is:

function domain_init() {
  global $_domain;
  $_domain = array();

  // Cribbed from bootstrap.inc -- removes port protocols from the host value.
  $_subdomain = implode('.', array_reverse(explode(':', rtrim($_SERVER['HTTP_HOST'], '.'))));

  // Lookup the active domain against our allowed hosts record.
  $_domain = db_fetch_array(db_query("SELECT domain_id, subdomain, sitename FROM {domain} WHERE subdomain = '%s'", $_subdomain));

  // If empty, then the DNS didn't match anything, so use defaults.
  if (empty($_domain['domain_id'])) {
    $_domain = domain_default();
  }

  // Grant access to all affiliates.
  $_domain['site_grant'] = DOMAIN_SITE_GRANT;

}

This error causes the beta to not perform as designed.

Expect a release shortly.

Comments

agentrickard’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD. In beta3 release.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.