Closed (fixed)
Project:
Domain
Version:
5.x-1.0beta2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Oct 2007 at 19:33 UTC
Updated:
12 Nov 2007 at 22:42 UTC
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
Comment #1
agentrickardCommitted to HEAD. In beta3 release.
Comment #2
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.