*/
public function addScriptFile( $file ) {
global $wgStylePath, $wgStyleVersion;
- if( substr( $file, 0, 1 ) == '/' ) {
+ if( substr( $file, 0, 1 ) == '/' || substr( $file, 0, 7 ) == 'http://' ) {
$path = $file;
} else {
$path = "{$wgStylePath}/common/{$file}";
}
- $this->addScript( Html::linkedScript( "$path?$wgStyleVersion" ) );
+ $this->addScript( Html::linkedScript( wfAppendQuery( $path, $wgStyleVersion ) ) );
}
/**
/**
* Set whether the output should only contain the body of the article,
* without any skin, sidebar, etc.
- * Used e.g. when calling with "action=raw".
+ * Used e.g. when calling with "action=render".
*
* @param $only Boolean: whether to output only the body of the article
*/
}
/**
- * "Page title" means the contents of <h1>. It is stored as a valid HTML fragment.
- * This function allows good tags like <sup> in the <h1> tag, but not bad tags like <script>.
- * This function automatically sets <title> to the same content as <h1> but with all tags removed.
- * Bad tags that were escaped in <h1> will still be escaped in <title>, and good tags like <i> will be dropped entirely.
+ * "Page title" means the contents of \<h1\>. It is stored as a valid HTML fragment.
+ * This function allows good tags like \<sup\> in the \<h1\> tag, but not bad tags like \<script\>.
+ * This function automatically sets \<title\> to the same content as \<h1\> but with all tags removed.
+ * Bad tags that were escaped in \<h1\> will still be escaped in \<title\>, and good tags like \<i\> will be dropped entirely.
*/
public function setPageTitle( $name ) {
# change "<script>foo&bar</script>" to "<script>foo&bar</script>"
}
/**
- * Return the "page title", i.e. the content of the <h1> tag.
+ * Return the "page title", i.e. the content of the \<h1\> tag.
*
* @return String
*/
$response->header( 'Cache-Control: no-cache, no-store, max-age=0, must-revalidate' );
$response->header( 'Pragma: no-cache' );
}
- wfRunHooks('CacheHeadersAfterSet', array( $this ) );
}
/**
# Much saner.
$ret .= "<!doctype html>\n";
}
- $ret .= "<html lang=\"$wgContLanguageCode\" dir=\"$dir\" ";
- if ( $wgHtml5Version ) $ret .= " version=\"$wgHtml5Version\" ";
+ $ret .= "<html lang=\"$wgContLanguageCode\" dir=\"$dir\"";
+ if ( $wgHtml5Version ) $ret .= " version=\"$wgHtml5Version\"";
$ret .= ">\n";
} else {
$ret .= "<!DOCTYPE html PUBLIC \"$wgDocType\" \"$wgDTD\">\n";
foreach($wgXhtmlNamespaces as $tag => $ns) {
$ret .= "xmlns:{$tag}=\"{$ns}\" ";
}
- $ret .= "xml:lang=\"$wgContLanguageCode\" lang=\"$wgContLanguageCode\" dir=\"$dir\">\n";
+ $ret .= "lang=\"$wgContLanguageCode\" dir=\"$dir\">\n";
}
$ret .= "<head>\n";
* @return Array: the list of modules which were not loaded.
*/
public function includeJQuery( $modules = array() ) {
- global $wgScriptPath, $wgStyleVersion, $wgJsMimeType;
+ global $wgStylePath, $wgStyleVersion, $wgJsMimeType;
$supportedModules = array( /** TODO: add things here */ );
$unsupported = array_diff( $modules, $supportedModules );
$params = array(
'type' => $wgJsMimeType,
- 'src' => "$wgScriptPath/skins/common/jquery.min.js?$wgStyleVersion",
+ 'src' => "$wgStylePath/common/jquery.min.js?$wgStyleVersion",
);
if ( !$this->mJQueryDone ) {
$this->mJQueryDone = true;