Index: trunk/phase3/includes/Preferences.php |
— | — | @@ -1160,19 +1160,20 @@ |
1161 | 1161 | } |
1162 | 1162 | |
1163 | 1163 | /** |
1164 | | - * @param $signature |
1165 | | - * @param $alldata |
| 1164 | + * @param $signature string |
| 1165 | + * @param $alldata array |
| 1166 | + * @param $form HTMLForm |
1166 | 1167 | * @return bool|string |
1167 | 1168 | */ |
1168 | | - static function validateSignature( $signature, $alldata ) { |
| 1169 | + static function validateSignature( $signature, $alldata, $form ) { |
1169 | 1170 | global $wgParser, $wgMaxSigChars; |
1170 | 1171 | if ( mb_strlen( $signature ) > $wgMaxSigChars ) { |
1171 | 1172 | return Xml::element( 'span', array( 'class' => 'error' ), |
1172 | | - wfMessage( 'badsiglength' )->numParams( $wgMaxSigChars )->text() ); |
| 1173 | + $form->msg( 'badsiglength' )->numParams( $wgMaxSigChars )->text() ); |
1173 | 1174 | } elseif ( isset( $alldata['fancysig'] ) && |
1174 | 1175 | $alldata['fancysig'] && |
1175 | 1176 | false === $wgParser->validateSig( $signature ) ) { |
1176 | | - return Xml::element( 'span', array( 'class' => 'error' ), wfMsg( 'badsig' ) ); |
| 1177 | + return Xml::element( 'span', array( 'class' => 'error' ), $form->msg( 'badsig' )->text() ); |
1177 | 1178 | } else { |
1178 | 1179 | return true; |
1179 | 1180 | } |
— | — | @@ -1181,9 +1182,10 @@ |
1182 | 1183 | /** |
1183 | 1184 | * @param $signature string |
1184 | 1185 | * @param $alldata array |
| 1186 | + * @param $form HTMLForm |
1185 | 1187 | * @return string |
1186 | 1188 | */ |
1187 | | - static function cleanSignature( $signature, $alldata ) { |
| 1189 | + static function cleanSignature( $signature, $alldata, $form ) { |
1188 | 1190 | global $wgParser; |
1189 | 1191 | if ( isset( $alldata['fancysig'] ) && $alldata['fancysig'] ) { |
1190 | 1192 | $signature = $wgParser->cleanSig( $signature ); |
— | — | @@ -1196,23 +1198,6 @@ |
1197 | 1199 | } |
1198 | 1200 | |
1199 | 1201 | /** |
1200 | | - * @param $email |
1201 | | - * @param $alldata |
1202 | | - * @return bool|String |
1203 | | - */ |
1204 | | - static function validateEmail( $email, $alldata ) { |
1205 | | - if ( $email && !Sanitizer::validateEmail( $email ) ) { |
1206 | | - return wfMsgExt( 'invalidemailaddress', 'parseinline' ); |
1207 | | - } |
1208 | | - |
1209 | | - global $wgEmailConfirmToEdit; |
1210 | | - if ( $wgEmailConfirmToEdit && !$email ) { |
1211 | | - return wfMsgExt( 'noemailtitle', 'parseinline' ); |
1212 | | - } |
1213 | | - return true; |
1214 | | - } |
1215 | | - |
1216 | | - /** |
1217 | 1202 | * @param $user User |
1218 | 1203 | * @param $context IContextSource |
1219 | 1204 | * @param $formClass string |
— | — | @@ -1229,7 +1214,7 @@ |
1230 | 1215 | |
1231 | 1216 | $htmlForm->setModifiedUser( $user ); |
1232 | 1217 | $htmlForm->setId( 'mw-prefs-form' ); |
1233 | | - $htmlForm->setSubmitText( wfMsg( 'saveprefs' ) ); |
| 1218 | + $htmlForm->setSubmitText( $context->msg( 'saveprefs' )->text() ); |
1234 | 1219 | # Used message keys: 'accesskey-preferences-save', 'tooltip-preferences-save' |
1235 | 1220 | $htmlForm->setSubmitTooltip( 'preferences-save' ); |
1236 | 1221 | $htmlForm->setSubmitID( 'prefsubmit' ); |
— | — | @@ -1532,7 +1517,7 @@ |
1533 | 1518 | |
1534 | 1519 | $t = SpecialPage::getTitleFor( 'Preferences', 'reset' ); |
1535 | 1520 | |
1536 | | - $html .= "\n" . Linker::link( $t, wfMsgHtml( 'restoreprefs' ) ); |
| 1521 | + $html .= "\n" . Linker::link( $t, $this->msg( 'restoreprefs' )->escaped() ); |
1537 | 1522 | |
1538 | 1523 | $html = Xml::tags( 'div', array( 'class' => 'mw-prefs-buttons' ), $html ); |
1539 | 1524 | |