r100422 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100421‎ | r100422 | r100423 >
Date:14:59, 21 October 2011
Author:platonides
Status:ok
Tags:
Comment:
Add required attribute to captcha answers per
http://www.mediawiki.org/wiki/Extension_talk:ConfirmEdit#HTML5_required_input_8261
This won't have any real-world effect until r67283
HTML5 form validation is enabled again.
Modified paths:
  • /trunk/extensions/ConfirmEdit/FancyCaptcha.class.php (modified) (history)
  • /trunk/extensions/ConfirmEdit/MathCaptcha.class.php (modified) (history)
  • /trunk/extensions/ConfirmEdit/QuestyCaptcha.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ConfirmEdit/MathCaptcha.class.php
@@ -22,7 +22,7 @@
2323 $index = $this->storeCaptcha( array( 'answer' => $answer ) );
2424
2525 $form = '<table><tr><td>' . $this->fetchMath( $sum ) . '</td>';
26 - $form .= '<td>' . Xml::input( 'wpCaptchaWord', false, false, array( 'tabindex' => '1' ) ) . '</td></tr></table>';
 26+ $form .= '<td>' . Html::input( 'wpCaptchaWord', false, false, array( 'tabindex' => '1', 'required' ) ) . '</td></tr></table>';
2727 $form .= Html::hidden( 'wpCaptchaId', $index );
2828 return $form;
2929 }
Index: trunk/extensions/ConfirmEdit/QuestyCaptcha.class.php
@@ -40,9 +40,10 @@
4141 }
4242 $index = $this->storeCaptcha( $captcha );
4343 return "<p><label for=\"wpCaptchaWord\">{$captcha['question']}</label> " .
44 - Xml::element( 'input', array(
 44+ Html::element( 'input', array(
4545 'name' => 'wpCaptchaWord',
4646 'id' => 'wpCaptchaWord',
 47+ 'required',
4748 'tabindex' => 1 ) ) . // tab in before the edit textarea
4849 "</p>\n" .
4950 Xml::element( 'input', array(
Index: trunk/extensions/ConfirmEdit/FancyCaptcha.class.php
@@ -69,9 +69,10 @@
7070 'id' => 'wpCaptchaId',
7171 'value' => $index ) ) .
7272 "<p>" .
73 - Xml::element( 'input', array(
 73+ Html::element( 'input', array(
7474 'name' => 'wpCaptchaWord',
7575 'id' => 'wpCaptchaWord',
 76+ 'required',
7677 'tabindex' => 1 ) ) . // tab in before the edit textarea
7778 "</p>\n";
7879 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r67283(bug 23769) Disable HTML5 form validation for now...simetrical17:18, 3 June 2010

Status & tagging log