Go to the documentation of this file.00001 <?php
00002
00003 if (!function_exists("wfProfileIn"))
00004 {
00005 function wfProfileIn($dummy)
00006 {
00007 }
00008 }
00009 if (!function_exists("wfProfileOut"))
00010 {
00011 function wfProfileOut($dummy)
00012 {
00013 }
00014 }
00015
00016
00017 function codepointToUtf8( $codepoint ) {
00018 if($codepoint < 0x80) return chr($codepoint);
00019 if($codepoint < 0x800) return chr($codepoint >> 6 & 0x3f | 0xc0) .
00020 chr($codepoint & 0x3f | 0x80);
00021 if($codepoint < 0x10000) return chr($codepoint >> 12 & 0x0f | 0xe0) .
00022 chr($codepoint >> 6 & 0x3f | 0x80) .
00023 chr($codepoint & 0x3f | 0x80);
00024 if($codepoint < 0x110000) return chr($codepoint >> 18 & 0x07 | 0xf0) .
00025 chr($codepoint >> 12 & 0x3f | 0x80) .
00026 chr($codepoint >> 6 & 0x3f | 0x80) .
00027 chr($codepoint & 0x3f | 0x80);
00028
00029 echo "Asked for code outside of range ($codepoint)\n";
00030 die( -1 );
00031 }
00032
00033
00034 define( 'UTF8_REPLACEMENT', "\xef\xbf\xbd" );
00035
00041 function wfUrlProtocols() {
00042 global $wgUrlProtocols;
00043
00044 $wgUrlProtocols = array(
00045 'http://',
00046 'https://',
00047 'ftp://',
00048 'irc://',
00049 'gopher://',
00050 'telnet://',
00051 'nntp://',
00052 'worldwind://',
00053 'mailto:',
00054 'news:'
00055 );
00056
00057
00058
00059
00060 if ( is_array( $wgUrlProtocols ) ) {
00061 $protocols = array();
00062 foreach ($wgUrlProtocols as $protocol)
00063 $protocols[] = preg_quote( $protocol, '/' );
00064
00065 return implode( '|', $protocols );
00066 } else {
00067 return $wgUrlProtocols;
00068 }
00069 }
00070
00071 include_once("./Services/Utilities/classes/Parser.php");
00072 include_once("./Services/Utilities/classes/Sanitizer.php");
00073
00074 class ilMWFakery
00075 {
00076 function getSkin() { return $this;}
00077
00078
00079 function makeExternalLink( $url, $text, $escape = true, $linktype = '', $ns = null )
00080 {
00081
00082
00083
00084
00085
00086 $url = htmlspecialchars( $url );
00087 if( $escape ) {
00088 $text = htmlspecialchars( $text );
00089 }
00090
00091
00092 $urlpath = parse_url($url, PHP_URL_PATH);
00093 $pi = pathinfo($urlpath);
00094 if (in_array(strtolower($pi["extension"]), array("jpg", "jpeg", "gif", "png")))
00095 {
00096 return '<img src="'.$url.'" border="0" />';
00097 }
00098 else
00099 {
00100 return '<a href="'.$url.'" target="_blank">'.$text.'</a>';
00101 }
00102
00103 }
00104
00105 function markNoConversion($text, $noParse=false) {return $text;}
00106
00107 function addExternalLink() {}
00108
00109 public function getNamespace() { return null;}
00110 }
00111
00112 $GLOBALS["wgContLang"] = new ilMWFakery();
00113
00114 class ilMWParserAdapter extends Parser
00115 {
00116 function __construct()
00117 {
00118 parent::__construct();
00119 $this->mOptions = new ilMWFakery();
00120 $this->mTitle = new ilMWFakery();
00121 $this->mOutput = new ilMWFakery();
00122 }
00123
00124 function maybeMakeExternalImage( $url ) { return false;}
00125 }
00126
00127 ?>