(bug 30335) Fix for HTMLForms using GET breaking when non-friendly URLs are used
authorJohn Du Hart <johnduhart@users.mediawiki.org>
Tue, 23 Aug 2011 19:56:15 +0000 (19:56 +0000)
committerJohn Du Hart <johnduhart@users.mediawiki.org>
Tue, 23 Aug 2011 19:56:15 +0000 (19:56 +0000)
RELEASE-NOTES-1.19
includes/HTMLForm.php

index 07babd5..87e66c1 100644 (file)
@@ -68,6 +68,8 @@ production.
 * (bug 11374) Improved diff readability for colorblind people.
 * (bug 26486) ResourceLoader modules with paths to nonexistent files cause PHP
   warnings/notices to be thrown.
+* (bug 30335) Fix for HTMLForms using GET breaking when non-friendly URLs are
+  used
 
 === API changes in 1.19 ===
 * (bug 19838) siprop=interwikimap can now use the interwiki cache.
index e9eaccc..e2ca127 100644 (file)
@@ -430,12 +430,18 @@ class HTMLForm {
         * @return String HTML.
         */
        function getHiddenFields() {
+               global $wgUsePathInfo;
+
                $html = '';
                if( $this->getMethod() == 'post' ){
                        $html .= Html::hidden( 'wpEditToken', $this->getUser()->editToken(), array( 'id' => 'wpEditToken' ) ) . "\n";
                        $html .= Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . "\n";
                }
 
+               if ( !$wgUsePathInfo && $this->getMethod() == 'get' ) {
+                       $html .= Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . "\n";
+               }
+
                foreach ( $this->mHiddenFields as $data ) {
                        list( $value, $attribs ) = $data;
                        $html .= Html::hidden( $attribs['name'], $value, $attribs ) . "\n";