Author: leithoff
New Revision: 55394
URL: http://svn.stylite.de/viewvc/egroupware?rev=55394&view=rev
Log:
further refinement on activate_links
Modified:
trunk/egroupware/api/src/Html.php
— trunk/egroupware/api/src/Html.php (original)
+++ trunk/egroupware/api/src/Html.php Tue Mar 15 16:30:17 2016
@@ -79,13 +79,26 @@
$NotHTTP = ‘(?<!://|" target="_blank">)’; // avoid running again on http://www links already handled above
$Domain2 = ‘www(.[\w-.]+)’;
$Subdir2 = ‘([\w-.,@?^=%&:/~+#]*[\w-@?^=%&/~+#])?’;
-
}
-
$result4 = preg_replace( $Expr, "$1<a href=\"http://www$2$3$4$5\" target=\"_blank\">www$2$3$4$5</a>$6", $result3 );
-
-
//return preg_replace( $Expr, "<a href=\"http://www$1$2\" target=\"_blank\">www$1$2</a>$3 ", $result );
-
// 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 $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