3if (!function_exists(
"wfProfileIn"))
5 function wfProfileIn($dummy)
9if (!function_exists(
"wfProfileOut"))
11 function wfProfileOut($dummy)
16include_once(
"./include/Unicode/UtfNormalUtil.php");
19define(
'UTF8_REPLACEMENT',
"\xef\xbf\xbd" );
27 global $wgUrlProtocols;
29 $wgUrlProtocols = array(
45 if ( is_array( $wgUrlProtocols ) ) {
47 foreach ($wgUrlProtocols as $protocol)
48 $protocols[] = preg_quote( $protocol,
'/' );
50 return implode(
'|', $protocols );
52 return $wgUrlProtocols;
56include_once(
"./Services/Utilities/classes/Parser.php");
57include_once(
"./Services/Utilities/classes/Sanitizer.php");
77 $urlpath = parse_url(
$url, PHP_URL_PATH);
78 $pi = pathinfo($urlpath);
79 if (in_array(strtolower($pi[
"extension"]), array(
"jpg",
"jpeg",
"gif",
"png")))
81 return '<img src="'.$url.
'" border="0" />';
85 return '<a href="'.$url.
'" target="_blank" rel="noopener">'.
$text.
'</a>';
103 parent::__construct();
An exception for terminatinating execution or to throw for unit testing.
wfUrlProtocols()
Returns a regular expression of url protocols.
makeExternalLink( $url, $text, $escape=true, $linktype='', $ns=null)
markNoConversion($text, $noParse=false)
maybeMakeExternalImage( $url)
make an image if it's allowed, either through the global option or through the exception