From: jenkins-bot Date: Sat, 9 Feb 2019 20:32:40 +0000 (+0000) Subject: Merge "Fix $magicWords for the Sanskrit language" into REL1_31 X-Git-Tag: 1.31.2~39 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=a3dcadab7b1e584254d72db95cc337ac1185cbbc;hp=6082c7e7e84104a32afee5290ef617d65045b993 Merge "Fix $magicWords for the Sanskrit language" into REL1_31 --- diff --git a/RELEASE-NOTES-1.31 b/RELEASE-NOTES-1.31 index bf4f7f1ff9..8453d90e03 100644 --- a/RELEASE-NOTES-1.31 +++ b/RELEASE-NOTES-1.31 @@ -16,13 +16,14 @@ THIS IS NOT A RELEASE YET * (T206976, T206977) Also in the bundled LocalisationUpdate and ParserFunctions extensions. * (T206979) Fix PHP 7.3 warnings of using "compact()" when some variables may not be set. - * Fix PHP 7.3 warnings "preg_replace(): [...] invalid range in character class" + * (T215632) FormatMetadata and UploadStash regexes fixed to be PHP 7.3-compatible. * Avoid PHP 7.2 warnings in DBConRefTest about count() on non-Countable * Suppress "Headers already sent" in PHP 7.2 too * (T206476) Output only to stderr in unit tests * (T207112) Add session_write_close() calls to SessionManager tests * oyejorge/less.php replaced with our fork wikimedia/less.php * (T209756) Updated wikimedia/ip-set from 1.2.0 to 1.3.0. + * (T213489) Avoid session double-start in Setup.php. * (T207540) Include IP address in "Login for $1 succeeded" log entry. * (T201781) Database: Allow selectFieldValues() to accept SQL fragments * (T205765) installer: Don't link to the obsolete "Extension Matrix" page @@ -48,6 +49,11 @@ THIS IS NOT A RELEASE YET if --lang is used with the command-line installer (install.php). * Fix addition of ug_expiry column to user_groups table on MSSQL. * (T204767) Add join conditions to ActiveUsersPager +* (T210621) User: Bypass repeatable-read when creating an actor_id. +* (T204531) rdbms: reduce LoadBalancer replication log spam. +* (T195525) Fix db error outage page. +* (T208871) The hard-coded Google search form on the database error page was + removed. == MediaWiki 1.31.1 == diff --git a/includes/Setup.php b/includes/Setup.php index f4025945eb..7b7cafcddb 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -869,11 +869,19 @@ if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) { $session->renew(); if ( MediaWiki\Session\PHPSessionHandler::isEnabled() && - ( $session->isPersistent() || $session->shouldRememberUser() ) + ( $session->isPersistent() || $session->shouldRememberUser() ) && + session_id() !== $session->getId() ) { // Start the PHP-session for backwards compatibility + if ( session_id() !== '' ) { + wfDebugLog( 'session', 'PHP session {old_id} was already started, changing to {new_id}', 'all', [ + 'old_id' => session_id(), + 'new_id' => $session->getId(), + ] ); + session_write_close(); + } session_id( $session->getId() ); - Wikimedia\quietCall( 'session_start' ); + session_start(); } unset( $session ); diff --git a/includes/exception/MWExceptionRenderer.php b/includes/exception/MWExceptionRenderer.php index dc8dfd0b3e..5d75036566 100644 --- a/includes/exception/MWExceptionRenderer.php +++ b/includes/exception/MWExceptionRenderer.php @@ -47,13 +47,15 @@ class MWExceptionRenderer { self::printError( self::getText( $e ) ); } elseif ( $mode === self::AS_PRETTY ) { self::statusHeader( 500 ); + self::header( "Content-Type: $wgMimeType; charset=utf-8" ); if ( $e instanceof DBConnectionError ) { self::reportOutageHTML( $e ); } else { - self::header( "Content-Type: $wgMimeType; charset=utf-8" ); self::reportHTML( $e ); } } else { + self::statusHeader( 500 ); + self::header( "Content-Type: $wgMimeType; charset=utf-8" ); if ( $eNew ) { $message = "MediaWiki internal error.\n\n"; if ( self::showBackTrace( $e ) ) { @@ -292,7 +294,7 @@ class MWExceptionRenderer { * @param Exception|Throwable $e */ private static function reportOutageHTML( $e ) { - global $wgShowDBErrorBacktrace, $wgShowHostnames, $wgShowSQLErrors; + global $wgShowDBErrorBacktrace, $wgShowHostnames, $wgShowSQLErrors, $wgSitename; $sorry = htmlspecialchars( self::msg( 'dberr-problems', @@ -317,55 +319,20 @@ class MWExceptionRenderer { } MessageCache::singleton()->disable(); // no DB access - - $html = "

$sorry

$again

$info

"; + $html = "\n" . + '' . + '' . + htmlspecialchars( $wgSitename ) . + '' . + '' . + "

$sorry

$again

$info

"; if ( $wgShowDBErrorBacktrace ) { $html .= '

Backtrace:

' .
 				htmlspecialchars( $e->getTraceAsString() ) . '
'; } - $html .= '
'; - $html .= self::googleSearchForm(); - + $html .= ''; echo $html; } - - /** - * @return string - */ - private static function googleSearchForm() { - global $wgSitename, $wgCanonicalServer, $wgRequest; - - $usegoogle = htmlspecialchars( self::msg( - 'dberr-usegoogle', - 'You can try searching via Google in the meantime.' - ) ); - $outofdate = htmlspecialchars( self::msg( - 'dberr-outofdate', - 'Note that their indexes of our content may be out of date.' - ) ); - $googlesearch = htmlspecialchars( self::msg( 'searchbutton', 'Search' ) ); - $search = htmlspecialchars( $wgRequest->getVal( 'search' ) ); - $server = htmlspecialchars( $wgCanonicalServer ); - $sitename = htmlspecialchars( $wgSitename ); - $trygoogle = <<$usegoogle
-$outofdate - -
- - - - - - -

- - -

-
-EOT; - return $trygoogle; - } } diff --git a/includes/libs/rdbms/loadbalancer/LoadBalancer.php b/includes/libs/rdbms/loadbalancer/LoadBalancer.php index 29793ee853..d5e65cdddf 100644 --- a/includes/libs/rdbms/loadbalancer/LoadBalancer.php +++ b/includes/libs/rdbms/loadbalancer/LoadBalancer.php @@ -311,7 +311,7 @@ class LoadBalancer implements ILoadBalancer { ": server {host} is not replicating?", [ 'host' => $host ] ); unset( $loads[$i] ); } elseif ( $lag > $maxServerLag ) { - $this->replLogger->info( + $this->replLogger->debug( __METHOD__ . ": server {host} has {lag} seconds of lag (>= {maxlag})", [ 'host' => $host, 'lag' => $lag, 'maxlag' => $maxServerLag ] diff --git a/includes/user/User.php b/includes/user/User.php index aa211841f8..76691eaa1c 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -2465,8 +2465,14 @@ class User implements IDBAccessObject, UserIdentity { $this->mActorId = (int)$dbw->insertId(); } else { // Outdated cache? - list( , $options ) = DBAccessObjectUtils::getDBOptions( $this->queryFlagsUsed ); - $this->mActorId = (int)$dbw->selectField( 'actor', 'actor_id', $q, __METHOD__, $options ); + // Use LOCK IN SHARE MODE to bypass any MySQL REPEATABLE-READ snapshot. + $this->mActorId = (int)$dbw->selectField( + 'actor', + 'actor_id', + $q, + __METHOD__, + [ 'LOCK IN SHARE MODE' ] + ); if ( !$this->mActorId ) { throw new CannotCreateActorException( "Cannot create actor ID for user_id={$this->getId()} user_name={$this->getName()}" diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 7ebdd5bcc1..ded741d796 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -4031,9 +4031,6 @@ "dberr-again": "Try waiting a few minutes and reloading.", "dberr-info": "(Cannot access the database: $1)", "dberr-info-hidden": "(Cannot access the database)", - "dberr-usegoogle": "You can try searching via Google in the meantime.", - "dberr-outofdate": "Note that their indexes of our content may be out of date.", - "dberr-cachederror": "This is a cached copy of the requested page, and may not be up to date.", "htmlform-invalid-input": "There are problems with some of your input.", "htmlform-select-badoption": "The value you specified is not a valid option.", "htmlform-int-invalid": "The value you specified is not an integer.", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index 0067c8f80f..70582784d8 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -4228,9 +4228,6 @@ "dberr-again": "This message does not allow any wiki nor html markup.", "dberr-info": "This message does not allow any wiki nor html markup. Parameters:\n* $1 - database server name\nSee also:\n* {{msg-mw|Dberr-info-hidden}} - hides database server name", "dberr-info-hidden": "This message does not allow any wiki nor html markup.\n\nSee also:\n* {{msg-mw|Dberr-info}} - shows database server name", - "dberr-usegoogle": "This message does not allow any wiki nor html markup.", - "dberr-outofdate": "{{doc-singularthey}}\nIn this sentence, '''their''' indexes refers to '''Google's''' indexes. This message does not allow any wiki nor html markup.", - "dberr-cachederror": "Used as error message at the bottom of the page.", "htmlform-invalid-input": "Used as error message in HTML forms.\n\n* {{msg-mw|Htmlform-required}}\n* {{msg-mw|Htmlform-float-invalid}}\n* {{msg-mw|Htmlform-int-invalid}}\n* {{msg-mw|Htmlform-int-toolow}}\n* {{msg-mw|Htmlform-int-toohigh}}\n* {{msg-mw|Htmlform-select-badoption}}", "htmlform-select-badoption": "Used as error message in HTML forms.\n\n* {{msg-mw|Htmlform-invalid-input}}\n* {{msg-mw|Htmlform-required}}\n* {{msg-mw|Htmlform-float-invalid}}\n* {{msg-mw|Htmlform-int-invalid}}\n* {{msg-mw|Htmlform-int-toolow}}\n* {{msg-mw|Htmlform-int-toohigh}}", "htmlform-int-invalid": "Used as error message in HTML forms.\n\n* {{msg-mw|Htmlform-invalid-input}}\n* {{msg-mw|Htmlform-required}}\n* {{msg-mw|Htmlform-float-invalid}}\n* {{msg-mw|Htmlform-int-toolow}}\n* {{msg-mw|Htmlform-int-toohigh}}\n* {{msg-mw|Htmlform-select-badoption}}",