3 if (!function_exists(
"wfProfileIn")) {
4 function wfProfileIn($dummy)
8 if (!function_exists(
"wfProfileOut")) {
9 function wfProfileOut($dummy)
14 include_once(
"./include/Unicode/UtfNormalUtil.php");
17 if (!defined(
'UTF8_REPLACEMENT')) {
18 define(
'UTF8_REPLACEMENT',
"\xef\xbf\xbd" );
28 global $wgUrlProtocols;
30 $wgUrlProtocols = array(
46 if (is_array($wgUrlProtocols)) {
48 foreach ($wgUrlProtocols as $protocol) {
49 $protocols[] = preg_quote($protocol,
'/');
52 return implode(
'|', $protocols);
54 return $wgUrlProtocols;
58 include_once(
"./Services/Utilities/classes/Parser.php");
59 include_once(
"./Services/Utilities/classes/Sanitizer.php");
78 $text = htmlspecialchars($text);
82 $urlpath = parse_url(
$url, PHP_URL_PATH);
83 $pi = pathinfo($urlpath);
84 if (in_array(strtolower($pi[
"extension"]), array(
"jpg",
"jpeg",
"gif",
"png"))) {
85 return '<img src="' .
$url .
'" border="0" />';
87 return '<a href="' .
$url .
'" target="_blank" rel="noopener">' . $text .
'</a>';
markNoConversion($text, $noParse=false)
makeExternalLink($url, $text, $escape=true, $linktype='', $ns=null)
maybeMakeExternalImage($url)
__construct(Container $dic, ilPlugin $plugin)
if(!defined('UTF8_REPLACEMENT')) wfUrlProtocols()
Returns a regular expression of url protocols.