Commit b83b3401 authored by Dries's avatar Dries

- Patch #10697 by matteo: avoid that administrators can create nodes with the wrong node type.
parent d8113fda
......@@ -1271,7 +1271,7 @@ function node_add($type) {
$edit = $_POST['edit'];
// If a node type has been specified, validate its existence.
if ($type && node_access('create', $type)) {
if (in_array($type, node_list()) && node_access('create', $type)) {
// Initialize settings:
$node = array('uid' => $user->uid, 'name' => $user->name, 'type' => $type);
......
......@@ -1271,7 +1271,7 @@ function node_add($type) {
$edit = $_POST['edit'];
// If a node type has been specified, validate its existence.
if ($type && node_access('create', $type)) {
if (in_array($type, node_list()) && node_access('create', $type)) {
// Initialize settings:
$node = array('uid' => $user->uid, 'name' => $user->name, 'type' => $type);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment