diff -Nruw mediawiki-1.33.2/extensions/OATHAuth/includes/special/SpecialDisableOATHForUser.php mediawiki-1.33.3/extensions/OATHAuth/includes/special/SpecialDisableOATHForUser.php
--- mediawiki-1.33.2/extensions/OATHAuth/includes/special/SpecialDisableOATHForUser.php	2019-12-19 13:46:08.000000000 +0000
+++ mediawiki-1.33.3/extensions/OATHAuth/includes/special/SpecialDisableOATHForUser.php	2020-03-26 17:15:39.000000000 +0000
@@ -56,6 +56,14 @@
 	}
 
 	/**
+	 * @param string $par
+	 */
+	public function execute( $par ) {
+		$this->getOutput()->disallowUserJs();
+		parent::execute( $par );
+	}
+
+	/**
 	 * @return array[]
 	 */
 	protected function getFormFields() {
diff -Nruw mediawiki-1.33.2/extensions/OATHAuth/includes/special/SpecialOATHDisable.php mediawiki-1.33.3/extensions/OATHAuth/includes/special/SpecialOATHDisable.php
--- mediawiki-1.33.2/extensions/OATHAuth/includes/special/SpecialOATHDisable.php	2019-12-19 13:46:08.000000000 +0000
+++ mediawiki-1.33.3/extensions/OATHAuth/includes/special/SpecialOATHDisable.php	2020-03-26 17:15:39.000000000 +0000
@@ -83,6 +83,14 @@
 	}
 
 	/**
+	 * @param string $par
+	 */
+	public function execute( $par ) {
+		$this->getOutput()->disallowUserJs();
+		parent::execute( $par );
+	}
+
+	/**
 	 * @return array[]
 	 */
 	protected function getFormFields() {
diff -Nruw mediawiki-1.33.2/extensions/OATHAuth/includes/special/SpecialOATHEnable.php mediawiki-1.33.3/extensions/OATHAuth/includes/special/SpecialOATHEnable.php
--- mediawiki-1.33.2/extensions/OATHAuth/includes/special/SpecialOATHEnable.php	2019-12-19 13:46:08.000000000 +0000
+++ mediawiki-1.33.3/extensions/OATHAuth/includes/special/SpecialOATHEnable.php	2020-03-26 17:15:39.000000000 +0000
@@ -86,6 +86,14 @@
 	}
 
 	/**
+	 * @param string $par
+	 */
+	public function execute( $par ) {
+		$this->getOutput()->disallowUserJs();
+		parent::execute( $par );
+	}
+
+	/**
 	 * @return array[]
 	 */
 	protected function getFormFields() {
diff -Nruw mediawiki-1.33.2/extensions/OATHAuth/modules/jquery.qrcode.js mediawiki-1.33.3/extensions/OATHAuth/modules/jquery.qrcode.js
--- mediawiki-1.33.2/extensions/OATHAuth/modules/jquery.qrcode.js	2019-12-19 13:46:08.000000000 +0000
+++ mediawiki-1.33.3/extensions/OATHAuth/modules/jquery.qrcode.js	2020-03-26 17:15:39.000000000 +0000
@@ -65,7 +65,7 @@
 			qrcode.make();
 
 			// create table element
-			$table = $( '<table></table>' )
+			$table = $( '<table>' )
 				.css( 'width', options.width + 'px' )
 				.css( 'height', options.height + 'px' )
 				.css( 'border', '0' )
@@ -78,10 +78,10 @@
 
 			// draw in the table
 			for ( row = 0; row < qrcode.getModuleCount(); row++ ) {
-				$row = $( '<tr></tr>' ).css( 'height', tileH + 'px' ).appendTo( $table );
+				$row = $( '<tr>' ).css( 'height', tileH + 'px' ).appendTo( $table );
 
 				for ( col = 0; col < qrcode.getModuleCount(); col++ ) {
-					$( '<td></td>' )
+					$( '<td>' )
 						.css( 'width', tileW + 'px' )
 						.css( 'background-color', qrcode.isDark( row, col ) ? options.foreground : options.background )
 						.appendTo( $row );
diff -Nruw mediawiki-1.33.2/includes/DefaultSettings.php mediawiki-1.33.3/includes/DefaultSettings.php
--- mediawiki-1.33.2/includes/DefaultSettings.php	2019-12-19 13:46:02.000000000 +0000
+++ mediawiki-1.33.3/includes/DefaultSettings.php	2020-03-26 17:15:33.000000000 +0000
@@ -71,8 +71,9 @@
 /**
  * MediaWiki version number
  * @since 1.2
+ * @deprecated since 1.35; use the MW_VERSION constant instead
  */
-$wgVersion = '1.33.2';
+$wgVersion = MW_VERSION;
 
 /**
  * Name of the site. It must be changed in LocalSettings.php
diff -Nruw mediawiki-1.33.2/includes/Defines.php mediawiki-1.33.3/includes/Defines.php
--- mediawiki-1.33.2/includes/Defines.php	2019-12-19 13:46:02.000000000 +0000
+++ mediawiki-1.33.3/includes/Defines.php	2020-03-26 17:15:33.000000000 +0000
@@ -29,6 +29,15 @@
  * @defgroup Constants MediaWiki constants
  */
 
+/**
+ * The running version of MediaWiki.
+ *
+ * This replaces the the $wgVersion global found in earlier versions.
+ *
+ * @since 1.33.3
+ */
+define( 'MW_VERSION', '1.33.3' );
+
 # Obsolete aliases
 /**
  * @deprecated since 1.28, use DB_REPLICA instead
diff -Nruw mediawiki-1.33.2/includes/MediaWikiVersionFetcher.php mediawiki-1.33.3/includes/MediaWikiVersionFetcher.php
--- mediawiki-1.33.2/includes/MediaWikiVersionFetcher.php	2019-11-04 18:09:13.000000000 +0000
+++ mediawiki-1.33.3/includes/MediaWikiVersionFetcher.php	2020-03-26 16:54:25.000000000 +0000
@@ -9,19 +9,19 @@
 class MediaWikiVersionFetcher {
 
 	/**
-	 * Returns the MediaWiki version, in the format used by MediaWiki's wgVersion global.
+	 * Get the MediaWiki version, extracted from the PHP source file where it is defined.
 	 *
 	 * @return string
 	 * @throws RuntimeException
 	 */
 	public function fetchVersion() {
-		$defaultSettings = file_get_contents( __DIR__ . '/DefaultSettings.php' );
+		$code = file_get_contents( __DIR__ . '/Defines.php' );
 
 		$matches = [];
-		preg_match( "/wgVersion = '([0-9a-zA-Z\.\-]+)';/", $defaultSettings, $matches );
+		preg_match( "/define\( 'MW_VERSION', '([0-9a-zA-Z\.\-]+)'/", $code, $matches );
 
 		if ( count( $matches ) !== 2 ) {
-			throw new RuntimeException( 'Could not extract the MediaWiki version from DefaultSettings.php' );
+			throw new RuntimeException( 'Could not extract the MediaWiki version from Defines.php' );
 		}
 
 		return $matches[1];
diff -Nruw mediawiki-1.33.2/includes/PHPVersionCheck.php mediawiki-1.33.3/includes/PHPVersionCheck.php
--- mediawiki-1.33.2/includes/PHPVersionCheck.php	2019-12-19 13:46:02.000000000 +0000
+++ mediawiki-1.33.3/includes/PHPVersionCheck.php	2020-03-26 17:15:33.000000000 +0000
@@ -110,7 +110,7 @@
 			'implementation' => 'PHP',
 			'version' => PHP_VERSION,
 			'vendor' => 'the PHP Group',
-			'upstreamSupported' => '5.6.0',
+			'upstreamSupported' => '7.2.0',
 			'minSupported' => '7.0.13',
 			'upgradeURL' => 'https://secure.php.net/downloads.php',
 		);
diff -Nruw mediawiki-1.33.2/includes/user/UserGroupMembership.php mediawiki-1.33.3/includes/user/UserGroupMembership.php
--- mediawiki-1.33.2/includes/user/UserGroupMembership.php	2019-12-19 13:46:03.000000000 +0000
+++ mediawiki-1.33.3/includes/user/UserGroupMembership.php	2020-03-26 17:15:34.000000000 +0000
@@ -395,16 +395,20 @@
 
 		// link to the group description page, if it exists
 		$linkTitle = self::getGroupPage( $group );
-		if ( $linkTitle ) {
 			if ( $format === 'wiki' ) {
+			if ( $linkTitle ) {
 				$linkPage = $linkTitle->getFullText();
 				$groupLink = "[[$linkPage|$groupName]]";
 			} else {
-				$groupLink = Linker::link( $linkTitle, htmlspecialchars( $groupName ) );
+				$groupLink = $groupName;
 			}
 		} else {
+			if ( $linkTitle ) {
+				$groupLink = Linker::link( $linkTitle, htmlspecialchars( $groupName ) );
+			} else {
 			$groupLink = htmlspecialchars( $groupName );
 		}
+		}
 
 		if ( $expiry ) {
 			// format the expiry to a nice string
@@ -413,11 +417,15 @@
 			$expiryDT = $uiLanguage->userTimeAndDate( $expiry, $uiUser );
 			$expiryD = $uiLanguage->userDate( $expiry, $uiUser );
 			$expiryT = $uiLanguage->userTime( $expiry, $uiUser );
-			if ( $format === 'html' ) {
-				$groupLink = Message::rawParam( $groupLink );
-			}
+
+			if ( $format === 'wiki' ) {
 			return $context->msg( 'group-membership-link-with-expiry' )
 				->params( $groupLink, $expiryDT, $expiryD, $expiryT )->text();
+			} else {
+				$groupLink = Message::rawParam( $groupLink );
+				return $context->msg( 'group-membership-link-with-expiry' )
+					->params( $groupLink, $expiryDT, $expiryD, $expiryT )->escaped();
+			}
 		}
 		return $groupLink;
 	}
diff -Nruw mediawiki-1.33.2/maintenance/checkComposerLockUpToDate.php mediawiki-1.33.3/maintenance/checkComposerLockUpToDate.php
--- mediawiki-1.33.2/maintenance/checkComposerLockUpToDate.php	2019-11-04 18:09:16.000000000 +0000
+++ mediawiki-1.33.3/maintenance/checkComposerLockUpToDate.php	2020-03-02 01:05:32.000000000 +0000
@@ -2,6 +2,8 @@
 
 require_once __DIR__ . '/Maintenance.php';
 
+use Composer\Semver\Semver;
+
 /**
  * Checks whether your composer-installed dependencies are up to date
  *
@@ -38,7 +40,7 @@
 		$installed = $lock->getInstalledDependencies();
 		foreach ( $json->getRequiredDependencies() as $name => $version ) {
 			if ( isset( $installed[$name] ) ) {
-				if ( $installed[$name]['version'] !== $version ) {
+				if ( !SemVer::satisfies( $installed[$name]['version'], $version ) ) {
 					$this->output(
 						"$name: {$installed[$name]['version']} installed, $version required.\n"
 					);
diff -Nruw mediawiki-1.33.2/maintenance/recountCategories.php mediawiki-1.33.3/maintenance/recountCategories.php
--- mediawiki-1.33.2/maintenance/recountCategories.php	2019-12-19 13:36:54.000000000 +0000
+++ mediawiki-1.33.3/maintenance/recountCategories.php	2020-03-26 17:15:36.000000000 +0000
@@ -98,7 +98,7 @@
 
 	protected function doWork() {
 		$this->output( "Finding up to {$this->getBatchSize()} drifted rows " .
-			"starting at cat_id {$this->getBatchSize()}...\n" );
+			"greater than cat_id {$this->minimumId}...\n" );
 
 		$countingConds = [ 'cl_to = cat_title' ];
 		if ( $this->mode === 'subcats' ) {
diff -Nruw mediawiki-1.33.2/maintenance/view.php mediawiki-1.33.3/maintenance/view.php
--- mediawiki-1.33.2/maintenance/view.php	2019-12-19 13:46:05.000000000 +0000
+++ mediawiki-1.33.3/maintenance/view.php	2020-03-26 17:15:36.000000000 +0000
@@ -39,6 +39,10 @@
 		$title = Title::newFromText( $this->getArg( 0 ) );
 		if ( !$title ) {
 			$this->fatalError( "Invalid title" );
+		} elseif ( $title->isSpecialPage() ) {
+			$this->fatalError( "Special Pages not supported" );
+		} elseif ( !$title->exists() ) {
+			$this->fatalError( "Page does not exist" );
 		}
 
 		$page = WikiPage::factory( $title );
diff -Nruw mediawiki-1.33.2/RELEASE-NOTES-1.33 mediawiki-1.33.3/RELEASE-NOTES-1.33
--- mediawiki-1.33.2/RELEASE-NOTES-1.33	2019-12-19 13:46:02.000000000 +0000
+++ mediawiki-1.33.3/RELEASE-NOTES-1.33	2020-03-26 17:15:33.000000000 +0000
@@ -1,3 +1,18 @@
+== MediaWiki 1.33.3 ==
+
+This is a security and maintenance release of the MediaWiki 1.33 branch.
+
+=== Changes since MediaWiki 1.33.2 ===
+* (T245072) mediawiki.language: Rename languageData back to languageNames.
+* Use proper SemVer comparison in CheckComposerLockUpToDate.
+* (T212738) Add the MW_VERSION constant, global $wgVersion is soft deprecated.
+* Update comment about PHP versions supported by The PHP Group.
+* (T247215) Fix output of RecountCategories::doWork().
+* Add check for page existence to view.php maintenance script.
+* (T236509) SECURITY: Fix HTML escaping in UserGroupMembership::getLink().
+* (T246602) SECURITY: jquery.makeCollapsible allows applying event handler to any
+  CSS selector.
+
 == MediaWiki 1.33.2 ==
 
 This is a security and maintenance release of the MediaWiki 1.33 branch.
diff -Nruw mediawiki-1.33.2/resources/src/jquery/jquery.makeCollapsible.js mediawiki-1.33.3/resources/src/jquery/jquery.makeCollapsible.js
--- mediawiki-1.33.2/resources/src/jquery/jquery.makeCollapsible.js	2019-12-19 13:46:05.000000000 +0000
+++ mediawiki-1.33.3/resources/src/jquery/jquery.makeCollapsible.js	2020-03-26 17:15:37.000000000 +0000
@@ -236,6 +236,7 @@
 			} else {
 				collapsibleId = $collapsible.attr( 'id' ) || '';
 				if ( collapsibleId.indexOf( 'mw-customcollapsible-' ) === 0 ) {
+					collapsibleId = $.escapeSelector( collapsibleId );
 					$customTogglers = $( '.' + collapsibleId.replace( 'mw-customcollapsible', 'mw-customtoggle' ) )
 						.addClass( 'mw-customtoggle' );
 				}
diff -Nruw mediawiki-1.33.2/resources/src/mediawiki.language/mediawiki.language.names.js mediawiki-1.33.3/resources/src/mediawiki.language/mediawiki.language.names.js
--- mediawiki-1.33.2/resources/src/mediawiki.language/mediawiki.language.names.js	2019-12-19 13:46:05.000000000 +0000
+++ mediawiki-1.33.3/resources/src/mediawiki.language/mediawiki.language.names.js	2020-03-26 16:55:44.000000000 +0000
@@ -1,4 +1,4 @@
 ( function () {
 	var names = require( './names.json' );
-	mw.language.setData( mw.config.get( 'wgUserLanguage' ), 'languageData', names );
+	mw.language.setData( mw.config.get( 'wgUserLanguage' ), 'languageNames', names );
 }() );
diff -Nruw mediawiki-1.33.2/tests/phpunit/includes/MediaWikiVersionFetcherTest.php mediawiki-1.33.3/tests/phpunit/includes/MediaWikiVersionFetcherTest.php
--- mediawiki-1.33.2/tests/phpunit/includes/MediaWikiVersionFetcherTest.php	2019-12-19 13:43:28.000000000 +0000
+++ mediawiki-1.33.3/tests/phpunit/includes/MediaWikiVersionFetcherTest.php	2020-03-26 17:15:37.000000000 +0000
@@ -15,9 +15,8 @@
 	use MediaWikiCoversValidator;
 
 	public function testReturnsResult() {
-		global $wgVersion;
 		$versionFetcher = new MediaWikiVersionFetcher();
-		$this->assertSame( $wgVersion, $versionFetcher->fetchVersion() );
+		$this->assertSame( MW_VERSION, $versionFetcher->fetchVersion() );
 	}
 
 }
