X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2FSetup.php;h=41d59455cfe6400352ff7c2ccad05d3550229f3f;hp=3cc52f8e255007bb3a0de256d2b69fd2cde12150;hb=23b7f3bbd553183a21d785bae175249efad5ee5d;hpb=a9d9f196de81b9ae6f1b30d46df60771339adb75 diff --git a/includes/Setup.php b/includes/Setup.php index 3cc52f8e25..41d59455cf 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -533,7 +533,7 @@ if ( $wgInvalidateCacheOnLocalSettingsChange ) { } if ( $wgNewUserLog ) { - // Add a new log type + // Add new user log type $wgLogTypes[] = 'newusers'; $wgLogNames['newusers'] = 'newuserlogpage'; $wgLogHeaders['newusers'] = 'newuserlogpagetext'; @@ -544,6 +544,12 @@ if ( $wgNewUserLog ) { $wgLogActionsHandlers['newusers/autocreate'] = NewUsersLogFormatter::class; } +if ( $wgPageCreationLog ) { + // Add page creation log type + $wgLogTypes[] = 'create'; + $wgLogActionsHandlers['create/create'] = LogFormatter::class; +} + if ( $wgPageLanguageUseDB ) { $wgLogTypes[] = 'pagelang'; $wgLogActionsHandlers['pagelang/pagelang'] = PageLangLogFormatter::class; @@ -730,20 +736,20 @@ if ( !$wgDBerrorLogTZ ) { // Initialize the request object in $wgRequest $wgRequest = RequestContext::getMain()->getRequest(); // BackCompat // Set user IP/agent information for agent session consistency purposes +$cpPosInfo = LBFactory::getCPInfoFromCookieValue( + // The cookie has no prefix and is set by MediaWiki::preOutputCommit() + $wgRequest->getCookie( 'cpPosIndex', '' ), + // Mitigate broken client-side cookie expiration handling (T190082) + time() - ChronologyProtector::POSITION_COOKIE_TTL +); MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->setRequestInfo( [ 'IPAddress' => $wgRequest->getIP(), 'UserAgent' => $wgRequest->getHeader( 'User-Agent' ), 'ChronologyProtection' => $wgRequest->getHeader( 'ChronologyProtection' ), - 'ChronologyPositionIndex' => $wgRequest->getInt( - 'cpPosIndex', - LBFactory::getCPIndexFromCookieValue( - // The cookie has no prefix and is set by MediaWiki::preOutputCommit() - $wgRequest->getCookie( 'cpPosIndex', '' ), - // Mitigate broken client-side cookie expiration handling (T190082) - time() - ChronologyProtector::POSITION_COOKIE_TTL - ) - ) + 'ChronologyPositionIndex' => $wgRequest->getInt( 'cpPosIndex', $cpPosInfo['index'] ), + 'ChronologyClientId' => $cpPosInfo['clientId'] ] ); +unset( $cpPosInfo ); // Make sure that object caching does not undermine the ChronologyProtector improvements if ( $wgRequest->getCookie( 'UseDC', '' ) === 'master' ) { // The user is pinned to the primary DC, meaning that they made recent changes which should @@ -819,7 +825,7 @@ $wgInitialSessionId = null; if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) { // If session.auto_start is there, we can't touch session name if ( $wgPHPSessionHandling !== 'disable' && !wfIniGetBool( 'session.auto_start' ) ) { - session_name( $wgSessionName ? $wgSessionName : $wgCookiePrefix . '_session' ); + session_name( $wgSessionName ?: $wgCookiePrefix . '_session' ); } // Create the SessionManager singleton and set up our session handler,