It hasn't been used for its documented purpose for a while.
In fact the one significant thing it can cause wasn't even
documented. If set to anything other than "text/javascript"
it will cause action=raw to no longer respond to
ctype=text/javascript requests (such as done by wikibits'
importScript function).
Follows-up
97caae596d5493.
Change-Id: Ib04ff5b21eb0ae172b94e31bc0dc16c9649e1864
* $wgXhtmlDefaultNamespace is no longer used by core. Setting it will no longer change the
xmlns used by MediaWiki. Reliance on this variable by extensions is deprecated.
* $wgHandheldStyle was removed.
+* $wgJsMimeType is no longer used by core. Most usage has been removed since
+ HTML output is now exclusively HTML5.
=== New features in 1.22 ===
* (bug 44525) mediawiki.jqueryMsg can now parse (whitelisted) HTML elements and attributes.
$wgMimeType = 'text/html';
/**
- * The content type used in script tags. This is mostly going to be ignored at
- * least for actual HTML output, since HTML5 doesn't require a MIME type for
- * JavaScript or CSS (those are the default script and style languages).
+ * Previously used as content type in HTML script tags. This is now ignored since
+ * HTML5 doesn't require a MIME type for script tags (javascript is the default).
+ * It was also previously used by RawAction to determine the ctype query parameter
+ * value that will result in a javascript response.
+ * @deprecated since 1.22
*/
-$wgJsMimeType = 'text/javascript';
+$wgJsMimeType = null;
/**
* The default xmlns attribute. The option to define this has been removed.
$wgActions[$action] = false;
}
-# We always output html5 since 1.22, override any change made by local settings
+# We always output HTML5 since 1.22, overriding these is no longer supported
+# we set them here for extensions that depend on its value.
$wgHtml5 = true;
-
-# Setting wgXhtmlDefaultNamespace is not supported since 1.22.
-# However we define it here for extensions that depend on its value.
$wgXhtmlDefaultNamespace = 'http://www.w3.org/1999/xhtml';
+$wgJsMimeType = 'text/javascript';
if ( !$wgHtml5Version && $wgAllowRdfaAttributes ) {
# see http://www.w3.org/TR/rdfa-in-html/#document-conformance
}
function onView() {
- global $wgSquidMaxage, $wgForcedRawSMaxage, $wgJsMimeType;
+ global $wgSquidMaxage, $wgForcedRawSMaxage;
$this->getOutput()->disable();
$request = $this->getRequest();
# Force caching for CSS and JS raw content, default: 5 minutes
if ( $smaxage === null ) {
- if ( $contentType == 'text/css' || $contentType == $wgJsMimeType ) {
+ if ( $contentType == 'text/css' || $contentType == 'text/javascript' ) {
$smaxage = intval( $wgForcedRawSMaxage );
} else {
$smaxage = 0;
* @return String
*/
public function getContentType() {
- global $wgJsMimeType;
-
$ctype = $this->getRequest()->getVal( 'ctype' );
if ( $ctype == '' ) {
$gen = $this->getRequest()->getVal( 'gen' );
if ( $gen == 'js' ) {
- $ctype = $wgJsMimeType;
+ $ctype = 'text/javascript';
} elseif ( $gen == 'css' ) {
$ctype = 'text/css';
}
}
- $allowedCTypes = array( 'text/x-wiki', $wgJsMimeType, 'text/css', 'application/x-zope-edit' );
+ $allowedCTypes = array( 'text/x-wiki', 'text/javascript', 'text/css', 'application/x-zope-edit' );
if ( $ctype == '' || !in_array( $ctype, $allowedCTypes ) ) {
$ctype = 'text/x-wiki';
}