GitInfo: Don't try shelling out if it's disabled
[lhc/web/wiklou.git] / includes / htmlform / fields / HTMLSelectOrOtherField.php
index a009b28..91050a0 100644 (file)
@@ -12,9 +12,7 @@ class HTMLSelectOrOtherField extends HTMLTextField {
                $this->getOptions();
                if ( !in_array( 'other', $this->mOptions, true ) ) {
                        $msg =
-                               isset( $params['other'] )
-                                       ? $params['other']
-                                       : wfMessage( 'htmlform-selectorother-other' )->text();
+                               $params['other'] ?? wfMessage( 'htmlform-selectorother-other' )->text();
                        // Have 'other' always as first element
                        $this->mOptions = [ $msg => 'other' ] + $this->mOptions;
                }
@@ -85,7 +83,6 @@ class HTMLSelectOrOtherField extends HTMLTextField {
 
                # DropdownInput
                $dropdownAttribs = [
-                       'id' => $this->mID,
                        'name' => $this->mName,
                        'options' => $this->getOptionsOOUI(),
                        'value' => $valInSelect ? $value : 'other',
@@ -103,7 +100,6 @@ class HTMLSelectOrOtherField extends HTMLTextField {
 
                # TextInput
                $textAttribs = [
-                       'id' => $this->mID . '-other',
                        'name' => $this->mName . '-other',
                        'size' => $this->getSize(),
                        'value' => $valInSelect ? '' : $value,
@@ -130,6 +126,7 @@ class HTMLSelectOrOtherField extends HTMLTextField {
                }
 
                return $this->getInputWidget( [
+                       'id' => $this->mID,
                        'textinput' => $textAttribs,
                        'dropdowninput' => $dropdownAttribs,
                        'or' => true,
@@ -137,7 +134,7 @@ class HTMLSelectOrOtherField extends HTMLTextField {
        }
 
        public function getInputWidget( $params ) {
-               return new Mediawiki\Widget\SelectWithInputWidget( $params );
+               return new MediaWiki\Widget\SelectWithInputWidget( $params );
        }
 
        /**