Skip to content
Snippets Groups Projects
Commit 1c1c7c8d authored by Tim Steiner's avatar Tim Steiner
Browse files

[gh-203] Merging from testing into staging

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x/staging@1089 20a16fea-79d4-4915-8869-1ea9d5ebf173
parent 2b91996a
No related branches found
No related tags found
No related merge requests found
......@@ -932,6 +932,33 @@ function unl_init() {
drupal_goto($primary_base_url . current_path());
}
}
_unl_handle_directory_index();
}
/**
* Custom function called by unl_init() to redirect users from
* a non-existant some/path/index.html to an existing some/path.
*/
function _unl_handle_directory_index() {
$path = current_path();
if (!in_array(basename($path), array('index.html', 'index.htm', 'index.shtml'))) {
return;
}
if (drupal_lookup_path('source', $path)) {
return;
}
if (drupal_lookup_path('source', dirname($path))) {
drupal_goto(dirname($path));
return;
}
if (dirname($path) == '.') {
drupal_goto('<front>');
return;
}
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment