diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/node.module | 12 | ||||
-rw-r--r-- | modules/node/node.module | 12 |
2 files changed, 16 insertions, 8 deletions
diff --git a/modules/node.module b/modules/node.module index 7ec69b207..b8471124c 100644 --- a/modules/node.module +++ b/modules/node.module @@ -1104,12 +1104,16 @@ function node_add($type) { */ if ($type && node_access("create", $type)) { - // Initialize settings - // TODO : clean up this code. + // Initialize settings: $node = array("uid" => $user->uid, "name" => $user->name, "type" => $type); + + /* + ** Allow the following fields to be initialized via $_GET (eg. for use + ** with a "blog it" bookmarklet): + */ foreach (array("title", "teaser", "body") as $field) { - if ($edit[$field]) { - $node[$field] = check_input($edit[$field]); + if ($_GET["edit"][$field]) { + $node[$field] = check_input($_GET["edit"][$field]); } } $output = node_form($node); diff --git a/modules/node/node.module b/modules/node/node.module index 7ec69b207..b8471124c 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1104,12 +1104,16 @@ function node_add($type) { */ if ($type && node_access("create", $type)) { - // Initialize settings - // TODO : clean up this code. + // Initialize settings: $node = array("uid" => $user->uid, "name" => $user->name, "type" => $type); + + /* + ** Allow the following fields to be initialized via $_GET (eg. for use + ** with a "blog it" bookmarklet): + */ foreach (array("title", "teaser", "body") as $field) { - if ($edit[$field]) { - $node[$field] = check_input($edit[$field]); + if ($_GET["edit"][$field]) { + $node[$field] = check_input($_GET["edit"][$field]); } } $output = node_form($node); |