summaryrefslogtreecommitdiff
path: root/modules/node
diff options
context:
space:
mode:
Diffstat (limited to 'modules/node')
-rw-r--r--modules/node/content_types.inc1
-rw-r--r--modules/node/node.admin.inc2
-rw-r--r--modules/node/node.module12
-rw-r--r--modules/node/node.pages.inc40
4 files changed, 27 insertions, 28 deletions
diff --git a/modules/node/content_types.inc b/modules/node/content_types.inc
index e7cd96097..e813a3b5e 100644
--- a/modules/node/content_types.inc
+++ b/modules/node/content_types.inc
@@ -18,7 +18,6 @@ function node_overview_types() {
foreach ($names as $key => $name) {
$type = $types[$key];
if (node_hook($type, 'form')) {
- $name = check_plain($name);
$type_url_str = str_replace('_', '-', $type->type);
$row = array(
l($name, 'admin/content/types/'. $type_url_str),
diff --git a/modules/node/node.admin.inc b/modules/node/node.admin.inc
index 138881a34..f4b7e85aa 100644
--- a/modules/node/node.admin.inc
+++ b/modules/node/node.admin.inc
@@ -385,7 +385,7 @@ function node_admin_nodes() {
while ($node = db_fetch_object($result)) {
$nodes[$node->nid] = '';
$form['title'][$node->nid] = array('#value' => l($node->title, 'node/'. $node->nid) .' '. theme('mark', node_mark($node->nid, $node->changed)));
- $form['name'][$node->nid] = array('#value' => node_get_types('name', $node));
+ $form['name'][$node->nid] = array('#value' => check_plain(node_get_types('name', $node)));
$form['username'][$node->nid] = array('#value' => theme('username', $node));
$form['status'][$node->nid] = array('#value' => ($node->status ? t('published') : t('not published')));
if ($multilanguage) {
diff --git a/modules/node/node.module b/modules/node/node.module
index 4433a1084..0a3696753 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1078,7 +1078,7 @@ function node_search($op = 'search', $keys = NULL) {
$form = array();
// Output form for defining rank factor weights.
$form['content_ranking'] = array(
- '#type' => 'fieldset',
+ '#type' => 'fieldset',
'#title' => t('Content ranking'),
);
$form['content_ranking']['#theme'] = 'node_search_admin';
@@ -1099,9 +1099,9 @@ function node_search($op = 'search', $keys = NULL) {
$options = drupal_map_assoc(range(0, 10));
foreach ($ranking as $var => $title) {
$form['content_ranking']['factors'][$var] = array(
- '#title' => $title,
- '#type' => 'select',
- '#options' => $options,
+ '#title' => $title,
+ '#type' => 'select',
+ '#options' => $options,
'#default_value' => variable_get($var, 5),
);
}
@@ -1199,7 +1199,7 @@ function node_search($op = 'search', $keys = NULL) {
$extra = node_invoke_nodeapi($node, 'search result');
$results[] = array('link' => url('node/'. $item->sid, array('absolute' => TRUE)),
- 'type' => node_get_types('name', $node),
+ 'type' => check_plain(node_get_types('name', $node)),
'title' => $node->title,
'user' => theme('username', $node),
'date' => $node->changed,
@@ -1699,7 +1699,7 @@ function node_form_alter(&$form, $form_state, $form_id) {
}
// Node types:
- $types = node_get_types('names');
+ $types = array_map('check_plain', node_get_types('names'));
$form['advanced']['type'] = array(
'#type' => 'checkboxes',
'#title' => t('Only of the type(s)'),
diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc
index 7fee7e481..8b994a4f7 100644
--- a/modules/node/node.pages.inc
+++ b/modules/node/node.pages.inc
@@ -116,14 +116,14 @@ function node_form(&$form_state, $node) {
*/
foreach (array('nid', 'vid', 'uid', 'created', 'type', 'language') as $key) {
$form[$key] = array(
- '#type' => 'value',
+ '#type' => 'value',
'#value' => isset($node->$key) ? $node->$key : NULL,
);
}
// Changed must be sent to the client, for later overwrite error checking.
$form['changed'] = array(
- '#type' => 'hidden',
+ '#type' => 'hidden',
'#default_value' => isset($node->changed) ? $node->changed : NULL,
);
// Get the node-specific bits.
@@ -171,18 +171,18 @@ function node_form(&$form_state, $node) {
'#weight' => 20,
);
$form['author']['name'] = array(
- '#type' => 'textfield',
- '#title' => t('Authored by'),
- '#maxlength' => 60,
- '#autocomplete_path' => 'user/autocomplete',
- '#default_value' => $node->name ? $node->name : '',
- '#weight' => -1,
+ '#type' => 'textfield',
+ '#title' => t('Authored by'),
+ '#maxlength' => 60,
+ '#autocomplete_path' => 'user/autocomplete',
+ '#default_value' => $node->name ? $node->name : '',
+ '#weight' => -1,
'#description' => t('Leave blank for %anonymous.', array('%anonymous' => variable_get('anonymous', t('Anonymous')))),
);
$form['author']['date'] = array(
- '#type' => 'textfield',
- '#title' => t('Authored on'),
- '#maxlength' => 25,
+ '#type' => 'textfield',
+ '#title' => t('Authored on'),
+ '#maxlength' => 25,
'#description' => t('Format: %time. Leave blank to use the time of form submission.', array('%time' => !empty($node->date) ? $node->date : format_date($node->created, 'custom', 'Y-m-d H:i:s O'))),
);
@@ -200,25 +200,25 @@ function node_form(&$form_state, $node) {
'#weight' => 25,
);
$form['options']['status'] = array(
- '#type' => 'checkbox',
- '#title' => t('Published'),
+ '#type' => 'checkbox',
+ '#title' => t('Published'),
'#default_value' => $node->status,
);
$form['options']['promote'] = array(
- '#type' => 'checkbox',
- '#title' => t('Promoted to front page'),
+ '#type' => 'checkbox',
+ '#title' => t('Promoted to front page'),
'#default_value' => $node->promote,
);
$form['options']['sticky'] = array(
- '#type' => 'checkbox',
- '#title' => t('Sticky at top of lists'),
+ '#type' => 'checkbox',
+ '#title' => t('Sticky at top of lists'),
'#default_value' => $node->sticky,
);
// These values are used when the user has no administrator access.
foreach (array('uid', 'created') as $key) {
$form[$key] = array(
- '#type' => 'value',
+ '#type' => 'value',
'#value' => $node->$key,
);
}
@@ -465,7 +465,7 @@ function node_form_submit_build_node($form, &$form_state) {
*/
function node_delete_confirm(&$form_state, $node) {
$form['nid'] = array(
- '#type' => 'value',
+ '#type' => 'value',
'#value' => $node->nid,
);
@@ -473,7 +473,7 @@ function node_delete_confirm(&$form_state, $node) {
t('Are you sure you want to delete %title?', array('%title' => $node->title)),
isset($_GET['destination']) ? $_GET['destination'] : 'node/'. $node->nid,
t('This action cannot be undone.'),
- t('Delete'),
+ t('Delete'),
t('Cancel')
);
}