From d17077d6fc616b0b4b58784d22bcb15ae11d17c5 Mon Sep 17 00:00:00 2001 From: John Du Hart Date: Tue, 23 Aug 2011 19:56:15 +0000 Subject: [PATCH] (bug 30335) Fix for HTMLForms using GET breaking when non-friendly URLs are used --- RELEASE-NOTES-1.19 | 2 ++ includes/HTMLForm.php | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 07babd54a5..87e66c19fb 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -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. diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index e9eacccd46..e2ca1277a1 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -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"; -- 2.20.1