Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-20206 Fix encoding in plain text checksum links #9917

Merged
merged 2 commits into from
Mar 3, 2017

Conversation

JKingsnorth
Copy link
Contributor

@JKingsnorth JKingsnorth commented Mar 2, 2017

@@ -1469,7 +1469,7 @@ private function getTokenData(&$token_a, $html = FALSE, &$contact, &$verp, &$url
if ($type == 'embedded_url') {
$embed_data = array();
foreach ($token as $t) {
$embed_data[] = $this->getTokenData($t, $html = FALSE, $contact, $verp, $urls, $event_queue_id);
$embed_data[] = $this->getTokenData($t, $html, $contact, $verp, $urls, $event_queue_id);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was always passing in true (because it was setting it to FALSE) - my brain hurts :P

@@ -1488,6 +1488,9 @@ private function getTokenData(&$token_a, $html = FALSE, &$contact, &$verp, &$url
$url .= '"';
}
$data = $url;
if (empty($html)) {
$data = str_replace('&', '&', $data);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like the other tokens, we need to replace html entities in plain text emails

@@ -1488,6 +1488,9 @@ private function getTokenData(&$token_a, $html = FALSE, &$contact, &$verp, &$url
$url .= '"';
}
$data = $url;
if (empty($html)) {
$data = str_replace('&', '&', $data);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JKingsnorth John could we use this function here https://github.com/civicrm/civicrm-core/blob/master/CRM/Utils/String.php#L439 to do the same thing?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eileenmcnaughton
Copy link
Contributor

Looking at the code the $html variable means 'encode for html', I would really prefer that the code comments for the variable were updated to clarify that, but, I agree that the fixes are correct & I'm going to merge. Thanks @seamuslee001 for digging out a pre-existing function.

@eileenmcnaughton eileenmcnaughton merged commit 44c0f8c into civicrm:master Mar 3, 2017
@JKingsnorth
Copy link
Contributor Author

@eileenmcnaughton #9938

monishdeb pushed a commit to monishdeb/civicrm-core that referenced this pull request May 2, 2017
CRM-20206 Fix encoding in plain text checksum links
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants