X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Finstaller%2FWebInstaller.php;h=545cc06caef8ab63979a55408c4889989268af8f;hb=b10c41a2947eea81a1b323952c928cda5263f837;hp=9d7e0514bb9b5a8db77b6f8e1267ee32f060ff22;hpb=9ced9ebca28e1ce2bed455da5ad9da208013ef18;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/WebInstaller.php b/includes/installer/WebInstaller.php index 9d7e0514bb..545cc06cae 100644 --- a/includes/installer/WebInstaller.php +++ b/includes/installer/WebInstaller.php @@ -341,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; @@ -915,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) @@ -937,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 { @@ -945,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"; }