Sorry, my english is very poor.

I´ve noticed that variables in first email validation are correct (!username, !site, !password, !uri,...). But if you try revalidate in edit account page, emails need variables whith "%" to show properly.

Is that an issue?

This is my first post in drupal.org. Thaks.

Comments

heimstein’s picture

Priority: Normal » Critical

re-validation email fails on D5 since all %-preceeded-placeholders seems to be replaced by !-preceeded-placeholders

solution:
change function logintoboggan_resend_validation($uid) at approx. line 881
from

 $variables = array('%username' => $account->name, '%site' => variable_get('site_name', 'drupal'), '%password' => $pass, '%uri' => $base_url, '%uri_brief' => substr($base_url, strlen(_logintoboggan_protocol() .'://')), '%mailto' => $account->mail, '%date' => format_date(time()), '%login_uri' => url('user', NULL, NULL, TRUE), '%edit_uri' => url('user/'. $account->uid .'/edit', NULL, NULL, TRUE), '%login_url' => logintoboggan_eml_validate_url($account));

to

  $variables = array('!username' => $account->name, '!site' => variable_get('site_name', 'drupal'), '%password' => $pass, '!uri' => $base_url, '!uri_brief' => substr($base_url, strlen(_logintoboggan_protocol() .'://')), '!mailto' => $account->mail, '%date' => format_date(time()), '!login_uri' => url('user', NULL, NULL, TRUE), '!edit_uri' => url('user/'. $account->uid .'/edit', NULL, NULL, TRUE), '!login_url' => logintoboggan_eml_validate_url($account));

and all wil be good again...

fellow’s picture

I confirm this bug.

heimstein your solution does work for me!

the only problem now is with password because in re-validation email, is still: "!password" . :)

john.money’s picture

Typo... change the %password and %date to !password and !date

mlncn’s picture

Status: Active » Needs work
StatusFileSize
new1.34 KB

This fix works. Is it the most Drupal way fix in light of this:

Altered the behaviour of placeholders in t() calls
http://drupal.org/node/64279#t-placeholders
?

Here it is as a patch, in any case. (If this patch isn't quite the right format -- should it be made from within or just above the logintoboggan directory for instance -- please let me know.)

~ ben, Agaric Design Collective

MattKelly’s picture

Yep, this works great- I just found the same problem.

dkruglyak’s picture

Title: revalidate email change variables » Fix text substitution variables
Status: Needs work » Reviewed & tested by the community
StatusFileSize
new11.32 KB

There are more places where substitution needs to be correct. Attaching the patch, let's get it into CVS.

hunmonk’s picture

Status: Reviewed & tested by the community » Needs work

the last patch is making erroneous changes to the t() placeholders. please re-read how to use t() in drupal 5, and especially How to handle text in a secure fashion -- using the ! style when outputting to the browser window opens an XSS attack vector.

hunmonk’s picture

Status: Needs work » Fixed

i applied the patch in #4 with a small correction -- one of the variables was missed.

Anonymous’s picture

Status: Fixed » Closed (fixed)