Escape '<' in attribute values for well-formed XML
[lhc/web/wiklou.git] / mwScriptLoader.php
1 <?php
2 /**
3 * mwScriptLoader.php
4 * Script Loading Library for MediaWiki
5 *
6 * @file
7 * @author Michael Dale mdale@wikimedia.org
8 * @date feb, 2009
9 * @link http://www.mediawiki.org/wiki/ScriptLoader Documentation
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 * http://www.gnu.org/copyleft/gpl.html
25 */
26
27 // include WebStart.php
28 require_once('includes/WebStart.php');
29
30 wfProfileIn( 'mwScriptLoader.php' );
31
32
33 if( $wgRequest->isPathInfoBad() ){
34 wfHttpError( 403, 'Forbidden',
35 'Invalid file extension found in PATH_INFO. ' .
36 'mwScriptLoader must be accessed through the primary script entry point.' );
37 return;
38 }
39 // Verify the script loader is on:
40 if ( !$wgEnableScriptLoader ) {
41 echo '/*ScriptLoader is not enabled for this site. To enable add the following line to your LocalSettings.php';
42 echo '<pre><b>$wgEnableScriptLoader=true;</b></pre>*/';
43 echo 'alert(\'Script loader is disabled\');';
44 die( 1 );
45 }
46
47 //moved to setup.php
48 // load the mwEmbed language file:
49 //$wgExtensionMessagesFiles['mwEmbed'] = "{$IP}/js2/mwEmbed/php/languages/mwEmbed.i18n.php";
50
51 // run jsScriptLoader action:
52 $myScriptLoader = new jsScriptLoader();
53 $myScriptLoader->doScriptLoader();
54
55 wfProfileOut( 'mwScriptLoader.php' );