Author: leithoff
New Revision: 55392
URL: http://svn.stylite.de/viewvc/egroupware?rev=55392&view=rev
Log:
further refinement on activate_links
Modified:
branches/14.2/phpgwapi/inc/class.html.inc.php
— branches/14.2/phpgwapi/inc/class.html.inc.php (original)
+++ branches/14.2/phpgwapi/inc/class.html.inc.php Tue Mar 15 16:19:29 2016
@@ -235,11 +235,26 @@
$NotHTTP = ‘(?<!://|" target="_blank">)’; // avoid running again on http://www links already handled above
$Domain2 = ‘www(.[\w-.]+)’;
$Subdir2 = ‘([\w-.,@?^=%&:/~+#]*[\w-@?^=%&/~+#])?’;
-
// use preg_replace_callback as we experienced problems with links such as <www.example.tld/pfad/zu/einer/pdf-Datei.pdf>
-
$result4 = preg_replace_callback( $Expr, function ($match) {
-
//error_log(__METHOD__.__LINE__.array2string($match));
-
if ($match[4]==';' && (strlen($match[3])-4) >=0 && strpos($match[3],'>',strlen($match[3])-4)!==false)
-
{
-
$match[3] = substr($match[3],0,strpos($match[3],'>',strlen($match[3])-4));
-
$match[4] = ">";
-
}
-
if ($match[4]==';'&&$match[3]==">")
-
{
-
$match[3] ='';
-
$match[4] = ">";
-
}
-
//error_log(__METHOD__.__LINE__.array2string($match));
-
return $match[1]."<a href=\"http://www".$match[2].$match[3]."\" target=\"_blank\">"."www".$match[2].$match[3]."</a>".$match[4];
-
}, $result3 );
-
//return preg_replace( $Expr, "<a href=\"http://www$1$2\" target=\"_blank\">www$1$2</a>$3 ", $result );
//error_log(METHOD.LINE.array2string($Expr));
//error_log(METHOD.LINE.array2string($result4));
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs