HTMLForm entity labels are now optional and escaped
[lhc/web/wiklou.git] / includes / Preferences.php
index 33780a4..d1a2344 100644 (file)
@@ -378,7 +378,7 @@ class Preferences {
                                        ? 'prefs-help-email-required'
                                        : 'prefs-help-email';
 
-                       if( $wgEnableUserEmail ) {
+                       if ( $wgEnableUserEmail ) {
                                // additional messages when users can send email to each other
                                $helpMessages[] = 'prefs-help-email-others';
                        }
@@ -432,7 +432,7 @@ class Preferences {
                                                                SpecialPage::getTitleFor( 'Confirmemail' ),
                                                                $context->msg( 'emailconfirmlink' )->escaped()
                                                        ) . '<br />';
-                                               $emailauthenticationclass="mw-email-not-authenticated";
+                                               $emailauthenticationclass = "mw-email-not-authenticated";
                                        }
                                } else {
                                        $disableEmailPrefs = true;
@@ -674,7 +674,7 @@ class Preferences {
                        'section' => 'rendering/advancedrendering',
                        'options' => $stubThresholdOptions,
                        'size' => 20,
-                       'label' => $context->msg( 'stub-threshold' )->text(), // Raw HTML message. Yay?
+                       'label-raw' => $context->msg( 'stub-threshold' )->text(), // Raw HTML message. Yay?
                );
 
                if ( $wgAllowUserCssPrefs ) {
@@ -1012,8 +1012,9 @@ class Preferences {
                $nsOptions = $wgContLang->getFormattedNamespaces();
                $nsOptions[0] = $context->msg( 'blanknamespace' )->text();
                foreach ( $nsOptions as $ns => $name ) {
-                       if ( $ns < 0 )
+                       if ( $ns < 0 ) {
                                unset( $nsOptions[$ns] );
+                       }
                }
 
                $defaultPreferences['searchnamespaces'] = array(
@@ -1260,6 +1261,7 @@ class Preferences {
        }
 
        /**
+        * @param $context IContextSource
         * @return array
         */
        static function getTimezoneOptions( IContextSource $context ) {
@@ -1350,7 +1352,9 @@ class Preferences {
                                        $data[0] = intval( $data[0] );
                                        $data[1] = intval( $data[1] );
                                        $minDiff = abs( $data[0] ) * 60 + $data[1];
-                                       if ( $data[0] < 0 ) $minDiff = - $minDiff;
+                                       if ( $data[0] < 0 ) {
+                                               $minDiff = - $minDiff;
+                                       }
                                } else {
                                        $minDiff = intval( $data[0] ) * 60;
                                }
@@ -1364,6 +1368,8 @@ class Preferences {
        }
 
        /**
+        * Handle the form submission if everything validated properly
+        *
         * @param $formData
         * @param $form PreferencesForm
         * @param $entryPoint string
@@ -1403,7 +1409,7 @@ class Preferences {
                # via $wgHiddenPrefs, we don't want to destroy that setting in case the preference
                # is subsequently re-enabled
                # TODO: maintenance script to actually delete these
-               foreach( $wgHiddenPrefs as $pref ) {
+               foreach ( $wgHiddenPrefs as $pref ) {
                        # If the user has not set a non-default value here, the default will be returned
                        # and subsequently discarded
                        $formData[$pref] = $user->getOption( $pref, null, true );