The link opening issue is true: not consistent, and not intentionally.
Thanks for working out the
details. I will try to tackle this, when I am getting to the
kses/htmlpurifier issue.
Hi, I’m currently using eGroupware 1.6.001 and I’m currently testing the
svn
version of 1.6. I’ve noticed that the handling of web site links has
changed
as of 1.6.001 which leads to 1) different way that the links are displayed
and 2) breaks some links (with variables). Going through the source of
class.uidisplay.inc.php (located in egroupware/felamimail/inc) I’ve
noticed
some changes that seem to contribute to both problems mentioned above.
Both issues seems related to the code in the function &getdisplayableBody.
In version 1.6.001, the link conversion for plain/text and other e-mails
are
all handled within the function itself, such as:
// create links for websites
$newBody =
preg_replace("/((http(s?)://)|(www.))([\w,-,/,?,=,.,&,!
n,!>,%,@,*,#,:,~,+]+)/ie",
"’
“$webserverURL/redirect.php?go=’.@htmlentities(urlencode(‘http$3://
$4$5’),ENT_QUOTES,”$this-
displayCharset").’" target="_blank">$2$4$5 '", $newBody);
whereas in the svn version, you use the functions html::activate_links
(located in egroupware/phpgwapi/inc) and parseHREF (located in
class.uidisplay.inc.php) to do the conversion.
And now to the differences and the issues they cause:
-
in 1.6.001, all the code for http link conversion include the
target="_blank" attribute for the tag that is created for the link. As of
the svn version, the html::activate_links functions uses the target
attribute, but parseHREF does not. Thus, HTML e-mails received in the svn
version of eGroupware do not open their html links in a new window, but in
the e-mail window, which makes link viewing inconsistent in the svn
version
of eGroupware (in 1.6.001, all links opened w/target="_blank", in svn,
text/plain messages have their links converted w/target="_blank", but html
links do not). Is this how it should be, or does parseHREF need to be
modified to include target="_blank" ?
-
As of svn, html links that contain variables, are broken. It looks like
this may have been addressed with r27288. The reason for the breakage may
be
the ?incorrect? calling of the redirect.php module itself. Please note
that
the notes in redirect.php say:
Use this in your app:
"
“$webserverURL/redirect.php?go=”.htmlentities(urlencode(‘http://www
.egroupware.org’)).’"
’
1.6.001 seems to adhere to this standard (see example above), but the svn
version of uidisplay do not. The code in parseHREF for creating the link
is
$comp_uri = " “$webserverURL/redirect.php?go=”.$link; $body =
str_replace(’ "’.$link, $comp_uri, $body);
(sorry for the extra raws, looks like the two line code snippet is given
the
raws a fit)
and for html::activate_links is
$result = preg_replace( $Expr, " “$0” $2$3$4 ", $result )
.
.
return preg_replace( $Expr, " “http://$0” $0 ", $result );
Notice that neither parseHREF, nor html::activate_links use the
"htmlentities(urlencode(" part to create their links and therefore,
redirect.php breaks. Please note that the solution provided in r27288
works,
but should redirect.php be modified because it is being called in a non
standard way or should the calling functions be modified?
Thanks,
Oliver.
View this message in context:
http://www.nabble.com/uidisplay-link-handling-inconsistencies---redi
rect.php-breakage-tp25030760s3741p25030760.html
Sent from the egroupware-developers mailing list archive at Nabble.com.
Let Crystal Reports handle the reporting - Free Crystal Reports 2008
30-Day
trial. Simplify your report design, integration and deployment - and focus
on
what you do best, core application coding. Discover what’s new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers