Commit efc73da7 authored by Chris Moates's avatar Chris Moates Committed by ergonlogic

Fix alias handling when using subdirs support (Drupal bug 2213387)

When the subdir module is enabled and subdirs are used, the template
that generates sites.php has a logic bug that causes it to unset()
aliases which are not subdir aliases. This patch checks each alias
before deciding whether to munge and unset it, thereby eliminating
the underlying bug.
Signed-off-by: ergonlogic's avatarChristopher Gervais <chris@ergonlogic.com>
parent 8bdada6e
......@@ -48,8 +48,12 @@ print "<?php \n"; ?>
$aliases = d()->aliases;
// Fix our subdir aliases.
foreach ($aliases as $alias) {
$records[str_replace('/', '.', $alias)] = $records[$alias];
unset($records[$alias]);
// Only replace the records[] array key if the alias is a subdir alias
// Patch for https://drupal.org/node/2213387
if(strpos($alias, "/")) {
$records[str_replace('/', '.', $alias)] = $records[$alias];
unset($records[$alias]);
}
}
?>
$sites = <?php print var_export($records, TRUE) ?>;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment