r78445 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78444‎ | r78445 | r78446 >
Date:19:33, 15 December 2010
Author:happy-melon
Status:ok (Comments)
Tags:
Comment:
Allow HTMLForms to be submitted by GET requests.
Modified paths:
  • /trunk/phase3/includes/HTMLForm.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/HTMLForm.php
@@ -92,6 +92,7 @@
9393 protected $mSubmitText;
9494 protected $mSubmitTooltip;
9595 protected $mTitle;
 96+ protected $mMethod = 'post';
9697
9798 protected $mUseMultipart = false;
9899 protected $mHiddenFields = array();
@@ -375,7 +376,7 @@
376377 # Attributes
377378 $attribs = array(
378379 'action' => $this->getTitle()->getFullURL(),
379 - 'method' => 'post',
 380+ 'method' => $this->mMethod,
380381 'class' => 'visualClear',
381382 'enctype' => $encType,
382383 );
@@ -586,6 +587,14 @@
587588 function getTitle() {
588589 return $this->mTitle;
589590 }
 591+
 592+ /**
 593+ * Set the method used to submit the form
 594+ * @param $method String
 595+ */
 596+ public function setMethod( $method='post' ){
 597+ $this->mMethod = $method;
 598+ }
590599
591600 /**
592601 * TODO: Document

Follow-up revisions

RevisionCommit summaryAuthorDate
r78448Follow-up r78445: validation errors would never be shown on a GET formhappy-melon20:10, 15 December 2010
r78454Follow-up r78445: don't spam a useless edit token into the URL for GET requests.happy-melon21:37, 15 December 2010
r798181.17: MFT r78445, r78448. Other merged HTMLForm revs depended on these (e.g. ...catrope14:33, 7 January 2011

Comments

#Comment by Nikerabbit (talk | contribs)   20:47, 15 December 2010

*nit-pick* white-space according to guidelines.

#Comment by Happy-melon (talk | contribs)   22:37, 15 December 2010

Where??

Status & tagging log