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

- Patch #218471 by pwolanin: menus and books exposed unpublished nodes.

parent ec9f8e09
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
...@@ -949,7 +949,7 @@ function menu_tree_check_access(&$tree, $node_links = array()) { ...@@ -949,7 +949,7 @@ function menu_tree_check_access(&$tree, $node_links = array()) {
// Use db_rewrite_sql to evaluate view access without loading each full node. // Use db_rewrite_sql to evaluate view access without loading each full node.
$nids = array_keys($node_links); $nids = array_keys($node_links);
$placeholders = '%d'. str_repeat(', %d', count($nids) - 1); $placeholders = '%d'. str_repeat(', %d', count($nids) - 1);
$result = db_query(db_rewrite_sql("SELECT n.nid FROM {node} n WHERE n.nid IN (". $placeholders .")"), $nids); $result = db_query(db_rewrite_sql("SELECT n.nid FROM {node} n WHERE n.status = 1 AND n.nid IN (". $placeholders .")"), $nids);
while ($node = db_fetch_array($result)) { while ($node = db_fetch_array($result)) {
$nid = $node['nid']; $nid = $node['nid'];
foreach ($node_links[$nid] as $mlid => $link) { foreach ($node_links[$nid] as $mlid => $link) {
......
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