# Bugs #2035: Problem replacing links in HTML-Mails

**URL:** <https://help.egroupware.org/t/bugs-2035-problem-replacing-links-in-html-mails/44562>\
**Category:** eGW-tracker\
**Created:** [December 21, 2010, 9:30am UTC](https://help.egroupware.org/t/bugs-2035-problem-replacing-links-in-html-mails/44562 "2010-12-21T09:30:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tracker-3](https://help.egroupware.org/letter_avatar_proxy/v4/letter/t/d07c76/32.png) [@tracker-3](https://help.egroupware.org/u/tracker-3)\
**Post date:** [December 21, 2010, 9:30am UTC](https://help.egroupware.org/t/bugs-2035-problem-replacing-links-in-html-mails/44562/1 "2010-12-21T09:30:52Z")

</div>

Ticket modified by Klaus Leithoff at 2010/12/21 10:30  
Tracking System: Bugs  
Category: FelamiMail  
Version: Trunk  
Status: Open  
Resolution: Accepted  
Completed: 30%  
Priority: 5 - medium  
Created By: Sebastian Meyer  
Assigned to: Klaus Leithoff  
Summary: #2035 - Problem replacing links in HTML-Mails  
FelamiMail replaces all links in the mail-body with links using the /redirect.php, but it does not work on HTML-Mails.

Following content of the body:  
View Document  
Normally this will create a link with the Text “Vie Document” with a link to the specified URL.

But viewing such a mail using FelamiMail creating following HTML-Code:  
Vie Document

The problem seems inside the class.uidisplay.inc.php:  
On line 1015 there is a pre\_replace which modifies the link inside the mail because the regex matches the link.  
On line 1019 there is also a pre\_replace which modifies the linke because the regex matches the link.

It could help testing in line 1015 for a not existing href=’|" in front of the link.

Greetings  
Sebastian Meyer  
Comment by Tracking System at 2010/12/17 18:02:  
This Tracker item was closed automatically by the system. It was previously set to a Pending status, and the original submitter did not respond within 14 days.  
Comment by Ralf Becker at 2010/12/03 17:49:  
Dear EGroupware user,

thanks for reporting bugs back to [egroupware.org](http://egroupware.org).

With the new release of EGroupware 1.8.001 we also fixed many bugs. So we kindly ask you to recheck your bug reports against the new version.

If you do not respond within the next 14 days, we assume the bug no longer exist and your report will be closed automatically.

Thanks for your understanding

Ralf Becker  
Stylite GmbH  
Comment by tyler zen at 2009/06/03 20:56:  
Where is this at? Same goes for me that all links refer to my domain address in front of the actual address without a proper redirection.  
Comment by Klaus Leithoff at 2009/05/22 14:19:  
by using html::activate\_link the problem seems to diminish  
But: Still some open issues with that.  
Comment by Klaus Leithoff at 2009/04/21 09:34:  
commited Sebastian Meyers suggestion to trunk for broader availability to tests: Revision 26830  
With my setup it looks o.k. up until now, but as Istvan states, further tests are needed.  
Comment by István Pongrácz at 2009/04/08 10:04:  
Hi,  
I have similar problem with links inside \< \>, even displaying plain messages.  
When this kind of link displayed, it is always include the \> character and those characters, which follow it.

The link will be similar:  
https : / / [mydomain.hu](http://mydomain.hu) / egroupware / redirect.php ? go=https %3A%2F%2F [mydomain.hu](http://mydomain.hu) %2F directory %2F action %2F52%23comment%3A6%26gt%3B%0ADomain

So, it would be nice to trim the character: ‘\>’ and all things after that. It seems, until the first space it includes all characters.

I try to solve it rewriting the preg\_replace (thank you for the hint) but until now I failed ☹  
Comment by Sebastian Meyer at 2009/04/06 15:52:  
Hmm… it seems the bug-tracker has the same problem, you can see it in my post.

Changing the pattern on line 1015 like this:  
"/(?\<!\>|/|&quot;|href=’|href=&quot;)((http(s?)://)|(www.))([\w,-,/,?,=,.,&,!\n,%,@,\*,#,:,~,+]+)/ie"

Now the links in HTML-Mails will work.  
Hope this will fix bug-tracker, too.

Regards  
Sebastian Meyer

linked entries:  
[http://www.egroupware.org/egroupware/index.php?menuaction=tracker.tracker\_ui.edit&tr\_id=2035&no\_popup=1](http://www.egroupware.org/egroupware/index.php?menuaction=tracker.tracker_ui.edit&tr_id=2035&no_popup=1)
