Skip to content
Snippets Groups Projects
Commit 7b713737 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #44298 by DriesK: prevent unaccessible links from being generated.

parent 0c4e12ae
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -1784,7 +1784,7 @@ function node_add($type) {
else {
// If no (valid) node type has been provided, display a node type overview.
foreach (node_get_types() as $type => $name) {
if (node_access('create', $type)) {
if (module_invoke(node_get_base($type), 'access', 'create', $type)) {
$out = '<dt>'. l($name, "node/add/$type", array('title' => t('Add a new %s.', array('%s' => $name)))) .'</dt>';
$out .= '<dd>'. implode("\n", module_invoke_all('help', 'node/add#'. $type)) .'</dd>';
$item[$name] = $out;
......
......@@ -1784,7 +1784,7 @@ function node_add($type) {
else {
// If no (valid) node type has been provided, display a node type overview.
foreach (node_get_types() as $type => $name) {
if (node_access('create', $type)) {
if (module_invoke(node_get_base($type), 'access', 'create', $type)) {
$out = '<dt>'. l($name, "node/add/$type", array('title' => t('Add a new %s.', array('%s' => $name)))) .'</dt>';
$out .= '<dd>'. implode("\n", module_invoke_all('help', 'node/add#'. $type)) .'</dd>';
$item[$name] = $out;
......
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