3 if (!function_exists(
"wfProfileIn"))
5 function wfProfileIn($dummy)
9 if (!function_exists(
"wfProfileOut"))
11 function wfProfileOut($dummy)
16 if (!function_exists(
'codepointToUtf8'))
20 if($codepoint < 0x80)
return chr($codepoint);
21 if($codepoint < 0x800)
return chr($codepoint >> 6 & 0x3f | 0xc0) .
22 chr($codepoint & 0x3f | 0x80);
23 if($codepoint < 0x10000)
return chr($codepoint >> 12 & 0x0f | 0xe0) .
24 chr($codepoint >> 6 & 0x3f | 0x80) .
25 chr($codepoint & 0x3f | 0x80);
26 if($codepoint < 0x110000)
return chr($codepoint >> 18 & 0x07 | 0xf0) .
27 chr($codepoint >> 12 & 0x3f | 0x80) .
28 chr($codepoint >> 6 & 0x3f | 0x80) .
29 chr($codepoint & 0x3f | 0x80);
31 echo
"Asked for code outside of range ($codepoint)\n";
37 define(
'UTF8_REPLACEMENT',
"\xef\xbf\xbd" );
45 global $wgUrlProtocols;
47 $wgUrlProtocols = array(
63 if ( is_array( $wgUrlProtocols ) ) {
65 foreach ($wgUrlProtocols as $protocol)
66 $protocols[] = preg_quote( $protocol,
'/' );
68 return implode(
'|', $protocols );
70 return $wgUrlProtocols;
74 include_once(
"./Services/Utilities/classes/Parser.php");
75 include_once(
"./Services/Utilities/classes/Sanitizer.php");
89 $url = htmlspecialchars( $url );
91 $text = htmlspecialchars( $text );
95 $urlpath = parse_url($url, PHP_URL_PATH);
96 $pi = pathinfo($urlpath);
97 if (in_array(strtolower($pi[
"extension"]), array(
"jpg",
"jpeg",
"gif",
"png")))
99 return '<img src="'.$url.
'" border="0" />';
103 return '<a href="'.$url.
'" target="_blank">'.$text.
'</a>';