Avoid duplicate IDs on Special:Preferences
[lhc/web/wiklou.git] / includes / specials / forms / PreferencesFormLegacy.php
index cae895f..c1f1026 100644 (file)
@@ -130,7 +130,8 @@ class PreferencesFormLegacy extends HTMLForm {
         * @return string
         */
        function getLegend( $key ) {
-               $legend = parent::getLegend( $key );
+               $aliasKey = ( $key === 'optoutwatchlist' || $key === 'optoutrc' ) ? 'opt-out' : $key;
+               $legend = parent::getLegend( $aliasKey );
                Hooks::run( 'PreferencesGetLegend', [ $this, $key, &$legend ] );
                return $legend;
        }