dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Avoid session double-start in Setup.php
[lhc/web/wiklou.git]
/
includes
/
Setup.php
diff --git
a/includes/Setup.php
b/includes/Setup.php
index
cc6915a
..
7b7cafc
100644
(file)
--- a/
includes/Setup.php
+++ b/
includes/Setup.php
@@
-280,7
+280,6
@@
if ( !$wgLocalFileRepo ) {
'name' => 'local',
'directory' => $wgUploadDirectory,
'scriptDirUrl' => $wgScriptPath,
'name' => 'local',
'directory' => $wgUploadDirectory,
'scriptDirUrl' => $wgScriptPath,
- 'scriptExtension' => '.php',
'url' => $wgUploadBaseUrl ? $wgUploadBaseUrl . $wgUploadPath : $wgUploadPath,
'hashLevels' => $wgHashedUploadDirectory ? 2 : 0,
'thumbScriptUrl' => $wgThumbnailScriptPath,
'url' => $wgUploadBaseUrl ? $wgUploadBaseUrl . $wgUploadPath : $wgUploadPath,
'hashLevels' => $wgHashedUploadDirectory ? 2 : 0,
'thumbScriptUrl' => $wgThumbnailScriptPath,
@@
-870,11
+869,19
@@
if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
$session->renew();
if ( MediaWiki\Session\PHPSessionHandler::isEnabled() &&
$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
) {
// 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() );
session_id( $session->getId() );
-
Wikimedia\quietCall( 'session_start'
);
+
session_start(
);
}
unset( $session );
}
unset( $session );