drupal_path_alias_whitelist_rebuild
- Versions
- 7
drupal_path_alias_whitelist_rebuild()
Rebuild the path alias white list.
Return value
An array containing a white list of path aliases.
Code
includes/path.inc, line 391
<?php
function drupal_path_alias_whitelist_rebuild() {
// For each alias in the database, get the top level component of the system
// path it corresponds to. This is the portion of the path before the first /
// if present, otherwise the whole path itself.
$whitelist = array();
$result = db_query("SELECT SUBSTRING_INDEX(source, '/', 1) AS path FROM {url_alias} GROUP BY path");
foreach ($result as $row) {
$whitelist[$row->path] = TRUE;
}
variable_set('path_alias_whitelist', $whitelist);
return $whitelist;
}
?>Login or register to post comments 