X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Finstaller%2FWebInstaller.php;h=545cc06caef8ab63979a55408c4889989268af8f;hb=b10c41a2947eea81a1b323952c928cda5263f837;hp=e0e54c845bd295723507d767a1db612dd31278da;hpb=426719108b86bba70e5b321e3386f40849471426;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/WebInstaller.php b/includes/installer/WebInstaller.php index e0e54c845b..545cc06cae 100644 --- a/includes/installer/WebInstaller.php +++ b/includes/installer/WebInstaller.php @@ -155,6 +155,10 @@ class WebInstaller extends Installer { if ( isset( $session['settings'] ) ) { $this->settings = $session['settings'] + $this->settings; + // T187586 MediaWikiServices works with globals + foreach ( $this->settings as $key => $val ) { + $GLOBALS[$key] = $val; + } } $this->setupLanguage(); @@ -337,11 +341,17 @@ class WebInstaller extends Installer { return true; } + // Use secure cookies if we are on HTTPS + $options = []; + if ( $this->request->getProtocol() === 'https' ) { + $options['cookie_secure'] = '1'; + } + $this->phpErrors = []; set_error_handler( [ $this, 'errorHandler' ] ); try { session_name( 'mw_installer_session' ); - session_start(); + session_start( $options ); } catch ( Exception $e ) { restore_error_handler(); throw $e; @@ -911,6 +921,7 @@ class WebInstaller extends Installer { * Parameters are: * var: The variable to be configured (required) * label: The message name for the label (required) + * labelAttribs:Additional attributes for the label element (optional) * attribs: Additional attributes for the input element (optional) * controlName: The name for the input element (optional) * value: The current value of the variable (optional) @@ -933,6 +944,9 @@ class WebInstaller extends Installer { if ( !isset( $params['help'] ) ) { $params['help'] = ""; } + if ( !isset( $params['labelAttribs'] ) ) { + $params['labelAttribs'] = []; + } if ( isset( $params['rawtext'] ) ) { $labelText = $params['rawtext']; } else { @@ -941,17 +955,19 @@ class WebInstaller extends Installer { return "
\n" . $params['help'] . - "\n" . + Html::rawElement( + 'label', + $params['labelAttribs'], + Xml::check( + $params['controlName'], + $params['value'], + $params['attribs'] + [ + 'id' => $params['controlName'], + 'tabindex' => $this->nextTabIndex(), + ] + ) . + $labelText . "\n" + ) . "
\n"; }