security update for uuid xmlsitemap file_field_path
This commit is contained in:
@@ -28,6 +28,20 @@ function uuid_token_info() {
|
||||
return $tokens;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_token_info_alter().
|
||||
*/
|
||||
function uuid_token_info_alter(&$data) {
|
||||
foreach (entity_get_info() as $entity_type => $info) {
|
||||
if (isset($info['uuid']) && $info['uuid'] == TRUE && !empty($info['entity keys']['uuid'])) {
|
||||
$token_type = !empty($info['token type']) ? $info['token type'] : $entity_type;
|
||||
if (empty($data['types'][$token_type])) {
|
||||
unset($data['tokens'][$token_type]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_tokens().
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user