diff --git a/core/modules/contact/contact.pages.inc b/core/modules/contact/contact.pages.inc index a62937b..50c6df7 100644 --- a/core/modules/contact/contact.pages.inc +++ b/core/modules/contact/contact.pages.inc @@ -76,8 +76,9 @@ function contact_site_form($form, &$form_state) { '#default_value' => $user->uid ? $user->mail : '', '#required' => TRUE, ); - // We do not allow authenticated users to alter their name and email - // here because they could impersonate someone else. + + // Do not allow authenticated usrs to alter the name or e-mail values to + // prevent the impersonation of other users. if ($user->uid){ // Change form elements to values. $form['name']['#type'] = $form['mail']['#type'] = 'value'; @@ -113,8 +114,8 @@ function contact_site_form($form, &$form_state) { '#title' => t('Message'), '#required' => TRUE, ); - // We do not allow anonymous users to send themselves a copy - // because it can be abused to spam people. + // Do not allow anonymous users to send themselves a copy because it can be + // abused to spam people. $form['copy'] = array( '#type' => 'checkbox', '#title' => t('Send yourself a copy.'), @@ -147,6 +148,7 @@ function contact_site_form_validate($form, &$form_state) { */ function contact_site_form_submit($form, &$form_state) { global $user, $language_interface; + $values = $form_state['values']; $values['sender'] = $user; $values['sender']->name = $values['name']; @@ -229,13 +231,13 @@ function contact_personal_form($form, &$form_state, $recipient) { '#default_value' => $user->uid ? $user->mail : '', '#required' => TRUE, ); - // We do not allow authenticated users to alter their name and email - // here because they could impersonate someone else. + // Do not allow authenticated users to alter the name or e-mail values to + // prevent the impersonation of other users. if ($user->uid){ // Change form elements to values. $form['name']['#type'] = $form['mail']['#type'] = 'value'; - // Display readonly name and mail address to the user. + // Display read-only name and mail address to the user. $form['name_display'] = array( '#type' => 'item', '#title' => t('Your name'), @@ -264,7 +266,7 @@ function contact_personal_form($form, &$form_state, $recipient) { '#rows' => 15, '#required' => TRUE, ); - // We do not allow anonymous users to send themselves a copy + // Do not allow anonymous users to send themselves a copy // because it can be abused to spam people. $form['copy'] = array( '#type' => 'checkbox', diff --git a/core/modules/contact/contact.test b/core/modules/contact/contact.test index cd3acc2..c903bbf 100644 --- a/core/modules/contact/contact.test +++ b/core/modules/contact/contact.test @@ -443,7 +443,7 @@ class ContactPersonalTestCase extends WebTestBase { /** * Tests the contact form for authenticated users. */ -class ContactAuthenticatedTestCase extends DrupalWebTestCase { +class ContactAuthenticatedTestCase extends WebTestBase { public static function getInfo() { return array(