Skip to content

Commit de8762b

Browse files
Issue #2380143 by Lendude, pwolanin: Contact forms set an incorrect name and e-mail address on the global user object after the form is submitted.
1 parent 84092f3 commit de8762b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.txt

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11

22
Drupal 7.35, xxxx-xx-xx (development version)
33
-----------------------
4+
- Fixed a bug in the Contact module which caused the global user object to have
5+
the incorrect name and e-mail address during the remainder of the page
6+
request after the contact form is submitted.
47

58
Drupal 7.34, 2014-11-19
69
----------------------

modules/contact/contact.pages.inc

+2-2
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ function contact_site_form_submit($form, &$form_state) {
134134
global $user, $language;
135135

136136
$values = $form_state['values'];
137-
$values['sender'] = $user;
137+
$values['sender'] = clone $user;
138138
$values['sender']->name = $values['name'];
139139
$values['sender']->mail = $values['mail'];
140140
$values['category'] = contact_load($values['cid']);
@@ -270,7 +270,7 @@ function contact_personal_form_submit($form, &$form_state) {
270270
global $user, $language;
271271

272272
$values = $form_state['values'];
273-
$values['sender'] = $user;
273+
$values['sender'] = clone $user;
274274
$values['sender']->name = $values['name'];
275275
$values['sender']->mail = $values['mail'];
276276

0 commit comments

Comments
 (0)