Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-7113

If a Token is included in a hyperlink in a mailing template and the Token is not at the end of the hyperlink, the hyperlink is truncated.

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.2.4
    • Fix Version/s: 3.3.beta
    • Component/s: CiviMail
    • Labels:
      None

      Description

      If a Token is placed inside a hyperlink, parsing the hyperlink truncates the hyperlink at the last token substitution.

      This appears to occur in the getDataFunc() function which does not append the leftover hyperlink after splitting it for insertion of the Token values.

      This problem can be solved, I believe, with the insertion of the following at line 533 in the file: CRM/Mailing/BAO/Mailing.php

      526 foreach ( $matches[1] as $match )

      { 527 $preg_token = '/'.preg_quote($match,'/').'/'; 528 $list = preg_split($preg_token,$token,2); EXISTING 529 $funcStruct['embed_parts'][] = $list[0]; 530 $token = $list[1]; 531 $funcStruct['token'][] = $this->getDataFunc($match); 532 }

      ------------------------------------------------------------------------------------------------
      533 if ($list[1])

      { 534 $funcStruct['embed_parts'][ ] = $list[1] ; INSERTED 535 }

      ------------------------------------------------------------------------------------------------
      536 } else

      { 537 $funcStruct['type'] = 'url'; EXISTING 538 }

        Attachments

          Activity

            People

            • Assignee:
              rajan Rajan P Mayekar
              Reporter:
              leonardwestermeyer Leonard Westermeyer
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 30 minutes
                30m
                Remaining:
                Remaining Estimate - 30 minutes
                30m
                Logged:
                Time Spent - Not Specified
                Not Specified