* @return Title Title object to be $wgTitle
*/
private function parseTitle() {
- global $wgContLang;
-
$request = $this->context->getRequest();
$curid = $request->getInt( 'curid' );
$title = $request->getVal( 'title' );
if ( !is_null( $ret ) && $ret->getNamespace() == NS_MEDIA ) {
$ret = Title::makeTitle( NS_FILE, $ret->getDBkey() );
}
+ $contLang = MediaWikiServices::getInstance()->getContentLanguage();
// Check variant links so that interwiki links don't have to worry
// about the possible different language variants
- if ( count( $wgContLang->getVariants() ) > 1
- && !is_null( $ret ) && $ret->getArticleID() == 0
+ if (
+ $contLang->hasVariants() && !is_null( $ret ) && $ret->getArticleID() == 0
) {
- $wgContLang->findVariantLink( $title, $ret );
+ $contLang->findVariantLink( $title, $ret );
}
}
/**
* @see MediaWiki::preOutputCommit()
- * @param callable $postCommitWork [default: null]
+ * @param callable|null $postCommitWork [default: null]
* @since 1.26
*/
public function doPreOutputCommit( callable $postCommitWork = null ) {
* the user can receive a response (in case commit fails)
*
* @param IContextSource $context
- * @param callable $postCommitWork [default: null]
+ * @param callable|null $postCommitWork [default: null]
* @since 1.27
*/
public static function preOutputCommit(
MWExceptionHandler::rollbackMasterChangesAndLog( $e );
}
+ // Disable WebResponse setters for post-send processing (T191537).
+ WebResponse::disableForPostSend();
+
$blocksHttpClient = true;
// Defer everything else if possible...
$callback = function () use ( $mode, &$blocksHttpClient ) {