allow <a> tags and RDFa attributes to support RDFa output from license templates etc
[lhc/web/wiklou.git] / mwScriptLoader.php
index ea772fc..4755f84 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * mvwScriptLoader.php
+ * mwScriptLoader.php
  * Script Loading Library for MediaWiki
  *
  * @file
  * http://www.gnu.org/copyleft/gpl.html
  */
 
+//first do a quick static check for the cached file
+define('MW_CACHE_SCRIPT_CHECK', true);
+require_once( dirname(__FILE__) . '/js2/mwEmbed/jsScriptLoader.php');
+$myScriptLoader = new jsScriptLoader();
+if( $myScriptLoader->outputFromCache() ){
+       exit();
+}
+
+//Else load up mediaWiki stuff and continue scriptloader processing:
+
 // include WebStart.php
+ob_start();
 require_once('includes/WebStart.php');
+$webstartwhitespace = ob_end_clean();
 
-wfProfileIn( 'mvwScriptLoader.php' );
+wfProfileIn( 'mwScriptLoader.php' );
 
-if( isset( $_SERVER['SCRIPT_URL'] ) ) {
-       $url = $_SERVER['SCRIPT_URL'];
-} else {
-       $url = $_SERVER['PHP_SELF'];
-}
-
-if( strpos( $url, "mwScriptLoader$wgScriptExtension" ) === false ){
+if( $wgRequest->isPathInfoBad() ){
        wfHttpError( 403, 'Forbidden',
-               'mvwScriptLoader must be accessed through the primary script entry point.' );
+               'Invalid file extension found in PATH_INFO. ' .
+               'mwScriptLoader must be accessed through the primary script entry point.' );
        return;
 }
 // Verify the script loader is on:
@@ -48,13 +55,9 @@ if ( !$wgEnableScriptLoader ) {
        die( 1 );
 }
 
-// load the mwEmbed language file:
-$wgExtensionMessagesFiles['mwEmbed'] = "{$IP}/js2/mwEmbed/php/languages/mwEmbed.i18n.php";
-// enable the msgs before we go on:
-wfLoadExtensionMessages( 'mwEmbed' );
-
-// run jsScriptLoader action:
-$myScriptLoader = new jsScriptLoader();
+//load the language file and
+// Run jsScriptLoader action:
 $myScriptLoader->doScriptLoader();
 
-wfProfileOut( 'mvwScriptLoader.php' );
\ No newline at end of file
+
+wfProfileOut( 'mwScriptLoader.php' );