r56947 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56946‎ | r56947 | r56948 >
Date:11:20, 26 September 2009
Author:happy-melon
Status:ok (Comments)
Tags:
Comment:
Fix bug in HTMLForm where password fields only got the type="password" attribute if $wgHtml5 = true. Prompted by r56937.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/HTMLForm.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/HTMLForm.php
@@ -572,22 +572,32 @@
573573 $attribs[$param] = '';
574574 }
575575 }
576 - if ( isset( $this->mParams['type'] ) ) {
 576+ }
 577+
 578+ # Implement tiny differences between some field variants
 579+ # here, rather than creating a new class for each one which
 580+ # is essentially just a clone of this one.
 581+ if ( isset( $this->mParams['type'] ) ) {
 582+ # Options that apply only to HTML5
 583+ if( $wgHtml5 ){
577584 switch ( $this->mParams['type'] ) {
578 - case 'email':
579 - $attribs['type'] = 'email';
580 - break;
581 - case 'int':
582 - $attribs['type'] = 'number';
583 - break;
584 - case 'float':
585 - $attribs['type'] = 'number';
586 - $attribs['step'] = 'any';
587 - break;
 585+ case 'email':
 586+ $attribs['type'] = 'email';
 587+ break;
 588+ case 'int':
 589+ $attribs['type'] = 'number';
 590+ break;
 591+ case 'float':
 592+ $attribs['type'] = 'number';
 593+ $attribs['step'] = 'any';
 594+ break;
 595+ }
 596+ }
 597+ # Options that apply to HTML4 as well
 598+ switch( $this->mParams['type'] ){
588599 case 'password':
589600 $attribs['type'] = 'password';
590601 break;
591 - }
592602 }
593603 }
594604
Index: trunk/phase3/RELEASE-NOTES
@@ -538,6 +538,8 @@
539539 * (bug 3421) Live preview no longer breaks user CSS/JS previews
540540 * (bug 11264) The file logo on a file description page for documents (PDF, ...)
541541 now links to the file rather than the file description page
 542+* Password fields built with HTMLForm now still have the type="password" attribute
 543+ if $wgHtml5=false.
542544
543545 == API changes in 1.16 ==
544546

Follow-up revisions

RevisionCommit summaryAuthorDate
r57096Recommit r56947, partially overwritten in r57024.happy-melon09:46, 30 September 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r56937Revert broken rewrite of login system; totally broken....brion00:49, 26 September 2009

Comments

#Comment by Brion VIBBER (talk | contribs)   01:07, 30 September 2009

This seems to be partly undone in r57024

Status & tagging log