CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Event Email Confirmation - Web addresses are being truncated at hyphen
Pages: [1]

Author Topic: Event Email Confirmation - Web addresses are being truncated at hyphen  (Read 1630 times)

phunter

  • I’m new here
  • *
  • Posts: 29
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Drupal 7
Event Email Confirmation - Web addresses are being truncated at hyphen
September 13, 2011, 06:17:48 am
If the "Send Confirmation Email?" Text includes a web url (http://exam-ple.com) the resultant confirmation email will include a hyperlink of http://exam. The remainder of the link is just plain text. This breaks the link.

The "Events - Registration Confirmation and Receipt (on-line)" Message template included the following lines.
Code: [Select]
<!-- BEGIN CONTENT -->

  <tr>
   <td>

    {if $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)}
     <p>{$event.confirm_email_text|htmlize}</p>
    {/if}


The smarty text modifier of "htmlize" looks like it is stripping out the hyperlink after any hyphen (-). I have tried to locate the code that runs this modifier in the smarty directory but so far have been unable to locate it. At this stage I am assuming this is causing the issues but would like to confirm.

Could someone point me in the right direction on this one?

Thanks

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Event Email Confirmation - Web addresses are being truncated at hyphen
September 13, 2011, 07:24:53 am

CRM/Core/Smarty/plugins/modifier.htmlize.php

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

phunter

  • I’m new here
  • *
  • Posts: 29
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Drupal 7
Re: Event Email Confirmation - Web addresses are being truncated at hyphen
September 13, 2011, 07:36:40 am
Thanks Lobo.

I was looking in the package directory.


phunter

  • I’m new here
  • *
  • Posts: 29
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Drupal 7
Re: Event Email Confirmation - Web addresses are being truncated at hyphen
September 13, 2011, 09:05:32 am
It seems there is an issue with the regular expression in the modifier.htmlize.php file.
The original line did not allow hyphens (-) in the directory location of the web address
The original line was:
Code: [Select]
$text = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', '<a href="$1">$1</a>', $text);

The error is in the middle of the line ([\w/_\.] with no hyphen in this block

NEW CODE
Code: [Select]
function smarty_modifier_htmlize($text)
{
    $text = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([-\w/_\.]*(\?\S+)?)?)?)@', '<a href="$1">$1</a>', $text);
    $text = nl2br($text);
    return $text;

Code an issue be raised and patch created for this?
I have tried to do as much as I can but not sure how to create a patch file etc.

Thanks

Paul

baergaj

  • I’m new here
  • *
  • Posts: 8
  • Karma: 1
  • CiviCRM version: 4.2
  • CMS version: Drupal 7.16
  • MySQL version: 5.5.27
  • PHP version: 5.3.17
Re: Event Email Confirmation - Web addresses are being truncated at hyphen
January 10, 2014, 01:11:29 pm
Thanks for sharing this, I was experiencing the same problem!

John.K

  • I post occasionally
  • **
  • Posts: 75
  • Karma: 5
  • CiviCRM version: 4.x
  • CMS version: Drupal 7
  • MySQL version: 5.x
  • PHP version: 5
Re: Event Email Confirmation - Web addresses are being truncated at hyphen
March 13, 2014, 04:07:35 pm
Just as info to anyone else coming across this issue. It has now been fixed for version 4.5: http://issues.civicrm.org/jira/browse/CRM-14347

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Event Email Confirmation - Web addresses are being truncated at hyphen

This forum was archived on 2017-11-26.