X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=includes%2FMediaWiki.php;h=b11239a1ca14f393a740c821c8e4c5121739faf8;hb=ead3a32d9f90da2d7ebc62dead7d3818c57734d2;hp=79787272ebee629cca5aed22867de8754902de4e;hpb=7f9d4153d267fc64d3a5161319eb57410df55a9b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index 79787272eb..b11239a1ca 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -104,7 +104,7 @@ class MediaWiki { if ( $ret === null || !$ret->isSpecialPage() ) { // We can have urls with just ?diff=,?oldid= or even just ?diff= $oldid = $request->getInt( 'oldid' ); - $oldid = $oldid ? $oldid : $request->getInt( 'diff' ); + $oldid = $oldid ?: $request->getInt( 'diff' ); // Allow oldid to override a changed or missing title if ( $oldid ) { $rev = Revision::newFromId( $oldid ); @@ -426,7 +426,7 @@ class MediaWiki { // If $target is set, then a hook wanted to redirect. if ( !$ignoreRedirect && ( $target || $page->isRedirect() ) ) { // Is the target already set by an extension? - $target = $target ? $target : $page->followRedirect(); + $target = $target ?: $page->followRedirect(); if ( is_string( $target ) ) { if ( !$this->config->get( 'DisableHardRedirects' ) ) { // we'll need to redirect @@ -568,7 +568,7 @@ class MediaWiki { /** * @see MediaWiki::preOutputCommit() - * @param callable $postCommitWork [default: null] + * @param callable|null $postCommitWork [default: null] * @since 1.26 */ public function doPreOutputCommit( callable $postCommitWork = null ) { @@ -580,7 +580,7 @@ class MediaWiki { * 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( @@ -723,6 +723,9 @@ class MediaWiki { 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 ) {