http://www.mediawiki.org/wiki/Special:Code/MediaWiki/84694

Revision: 84694
Author:   hashar
Date:     2011-03-24 19:26:32 +0000 (Thu, 24 Mar 2011)
Log Message:
-----------
reverts pretty URL in forms.

The correct fix is to use HTMLForm which generates pretty URLs

reverts r84571 r84572 & r84578

Modified Paths:
--------------
    branches/hashar/prettyURL/includes/SpecialPage.php
    branches/hashar/prettyURL/includes/specials/SpecialAllmessages.php
    branches/hashar/prettyURL/includes/specials/SpecialAllpages.php
    branches/hashar/prettyURL/includes/specials/SpecialBooksources.php
    branches/hashar/prettyURL/includes/specials/SpecialFileDuplicateSearch.php
    branches/hashar/prettyURL/includes/specials/SpecialFilepath.php
    branches/hashar/prettyURL/includes/specials/SpecialLinkSearch.php
    branches/hashar/prettyURL/includes/specials/SpecialMIMEsearch.php
    branches/hashar/prettyURL/includes/specials/SpecialMergeHistory.php
    branches/hashar/prettyURL/includes/specials/SpecialNewpages.php
    branches/hashar/prettyURL/includes/specials/SpecialPrefixindex.php
    branches/hashar/prettyURL/includes/specials/SpecialProtectedpages.php
    branches/hashar/prettyURL/includes/specials/SpecialProtectedtitles.php
    branches/hashar/prettyURL/includes/specials/SpecialRecentchanges.php
    branches/hashar/prettyURL/includes/specials/SpecialSearch.php
    branches/hashar/prettyURL/includes/specials/SpecialUndelete.php
    branches/hashar/prettyURL/includes/specials/SpecialUserrights.php
    branches/hashar/prettyURL/includes/specials/SpecialWhatlinkshere.php
    branches/hashar/prettyURL/includes/specials/SpecialWithoutinterwiki.php

Modified: branches/hashar/prettyURL/includes/SpecialPage.php
===================================================================
--- branches/hashar/prettyURL/includes/SpecialPage.php  2011-03-24 18:39:30 UTC 
(rev 84693)
+++ branches/hashar/prettyURL/includes/SpecialPage.php  2011-03-24 19:26:32 UTC 
(rev 84694)
@@ -944,15 +944,6 @@
        }
 
        /**
-        * Get a local URL suitable for <form action="">
-        *
-        * @return String this title local URL
-        */
-       function getFormAction( $subpage = false ) {
-               return self::getTitleFor( $this->mName, $subpage 
)->getLocalURL();
-       }
-
-       /**
         * Set whether this page is listed in Special:Specialpages, at run-time
         */
        function setListed( $listed ) {

Modified: branches/hashar/prettyURL/includes/specials/SpecialAllmessages.php
===================================================================
--- branches/hashar/prettyURL/includes/specials/SpecialAllmessages.php  
2011-03-24 18:39:30 UTC (rev 84693)
+++ branches/hashar/prettyURL/includes/specials/SpecialAllmessages.php  
2011-03-24 19:26:32 UTC (rev 84694)
@@ -83,11 +83,14 @@
        }
 
        function buildForm() {
+               global $wgScript;
+
                $languages = Language::getLanguageNames( false );
                ksort( $languages );
 
-               $out  = Xml::openElement( 'form', array( 'method' => 'get', 
'action' => $this->getFormAction(), 'id' => 'mw-allmessages-form' ) ) .
+               $out  = Xml::openElement( 'form', array( 'method' => 'get', 
'action' => $wgScript, 'id' => 'mw-allmessages-form' ) ) .
                        Xml::fieldset( wfMsg( 'allmessages-filter-legend' ) ) .
+                       Html::hidden( 'title', 
$this->getTitle()->getPrefixedText() ) .
                        Xml::openElement( 'table', array( 'class' => 
'mw-allmessages-table' ) ) . "\n" .
                        '<tr>
                                <td class="mw-label">' .

Modified: branches/hashar/prettyURL/includes/specials/SpecialAllpages.php
===================================================================
--- branches/hashar/prettyURL/includes/specials/SpecialAllpages.php     
2011-03-24 18:39:30 UTC (rev 84693)
+++ branches/hashar/prettyURL/includes/specials/SpecialAllpages.php     
2011-03-24 19:26:32 UTC (rev 84694)
@@ -95,9 +95,12 @@
         * @param $to String: dbKey we are ending listing at.
         */
        function namespaceForm( $namespace = NS_MAIN, $from = '', $to = '' ) {
+               global $wgScript;
+               $t = $this->getTitle();
 
                $out  = Xml::openElement( 'div', array( 'class' => 
'namespaceoptions' ) );
-               $out .= Xml::openElement( 'form', array( 'method' => 'get', 
'action' => $this->getFormAction() ) );
+               $out .= Xml::openElement( 'form', array( 'method' => 'get', 
'action' => $wgScript ) );
+               $out .= Html::hidden( 'title', $t->getPrefixedText() );
                $out .= Xml::openElement( 'fieldset' );
                $out .= Xml::element( 'legend', null, wfMsg( 'allpages' ) );
                $out .= Xml::openElement( 'table', array( 'id' => 'nsselect', 
'class' => 'allpages' ) );

Modified: branches/hashar/prettyURL/includes/specials/SpecialBooksources.php
===================================================================
--- branches/hashar/prettyURL/includes/specials/SpecialBooksources.php  
2011-03-24 18:39:30 UTC (rev 84693)
+++ branches/hashar/prettyURL/includes/specials/SpecialBooksources.php  
2011-03-24 19:26:32 UTC (rev 84694)
@@ -114,8 +114,11 @@
         * @return string
         */
        private function makeForm() {
+               global $wgScript;
+               $title = self::getTitleFor( 'Booksources' );
                $form  = '<fieldset><legend>' . wfMsgHtml( 
'booksources-search-legend' ) . '</legend>';
-               $form .= Xml::openElement( 'form', array( 'method' => 'get', 
'action' => $this->getFormAction() ) );
+               $form .= Xml::openElement( 'form', array( 'method' => 'get', 
'action' => $wgScript ) );
+               $form .= Html::hidden( 'title', $title->getPrefixedText() );
                $form .= '<p>' . Xml::inputLabel( wfMsg( 'booksources-isbn' ), 
'isbn', 'isbn', 20, $this->isbn );
                $form .= '&#160;' . Xml::submitButton( wfMsg( 'booksources-go' 
) ) . '</p>';
                $form .= Xml::closeElement( 'form' );

Modified: 
branches/hashar/prettyURL/includes/specials/SpecialFileDuplicateSearch.php
===================================================================
--- branches/hashar/prettyURL/includes/specials/SpecialFileDuplicateSearch.php  
2011-03-24 18:39:30 UTC (rev 84693)
+++ branches/hashar/prettyURL/includes/specials/SpecialFileDuplicateSearch.php  
2011-03-24 19:26:32 UTC (rev 84694)
@@ -91,7 +91,7 @@
        }
 
        function execute( $par ) {
-               global $wgRequest, $wgOut, $wgLang, $wgContLang;
+               global $wgRequest, $wgOut, $wgLang, $wgContLang, $wgScript;
 
                $this->setHeaders();
                $this->outputHeader();
@@ -106,7 +106,8 @@
 
                # Create the input form
                $wgOut->addHTML(
-                       Xml::openElement( 'form', array( 'id' => 
'fileduplicatesearch', 'method' => 'get', 'action' => $this->getFormAction() ) 
) .
+                       Xml::openElement( 'form', array( 'id' => 
'fileduplicatesearch', 'method' => 'get', 'action' => $wgScript ) ) .
+                       Html::hidden( 'title', 
$this->getTitle()->getPrefixedDbKey() ) .
                        Xml::openElement( 'fieldset' ) .
                        Xml::element( 'legend', null, wfMsg( 
'fileduplicatesearch-legend' ) ) .
                        Xml::inputLabel( wfMsg( 'fileduplicatesearch-filename' 
), 'filename', 'filename', 50, $this->filename ) . ' ' .

Modified: branches/hashar/prettyURL/includes/specials/SpecialFilepath.php
===================================================================
--- branches/hashar/prettyURL/includes/specials/SpecialFilepath.php     
2011-03-24 18:39:30 UTC (rev 84693)
+++ branches/hashar/prettyURL/includes/specials/SpecialFilepath.php     
2011-03-24 19:26:32 UTC (rev 84694)
@@ -71,12 +71,13 @@
        }
 
        function showForm( $title ) {
-               global $wgOut;
+               global $wgOut, $wgScript;
 
                $wgOut->addHTML(
-                       Html::openElement( 'form', array( 'method' => 'get', 
'action' => $this->getFormAction(), 'id' => 'specialfilepath' ) ) .
+                       Html::openElement( 'form', array( 'method' => 'get', 
'action' => $wgScript, 'id' => 'specialfilepath' ) ) .
                        Html::openElement( 'fieldset' ) .
                        Html::element( 'legend', null, wfMsg( 'filepath' ) ) .
+                       Html::hidden( 'title', 
$this->getTitle()->getPrefixedText() ) .
                        Xml::inputLabel( wfMsg( 'filepath-page' ), 'file', 
'file', 25, is_object( $title ) ? $title->getText() : '' ) . ' ' .
                        Xml::submitButton( wfMsg( 'filepath-submit' ) ) . "\n" .
                        Html::closeElement( 'fieldset' ) .

Modified: branches/hashar/prettyURL/includes/specials/SpecialLinkSearch.php
===================================================================
--- branches/hashar/prettyURL/includes/specials/SpecialLinkSearch.php   
2011-03-24 18:39:30 UTC (rev 84693)
+++ branches/hashar/prettyURL/includes/specials/SpecialLinkSearch.php   
2011-03-24 19:26:32 UTC (rev 84694)
@@ -42,7 +42,6 @@
                return false;
        }
 
-       /** @todo rewrite this function to make it cleaner! Please? :( */
        function execute( $par ) {
                global $wgOut, $wgRequest, $wgUrlProtocols, $wgMiserMode, 
$wgLang;
                $this->setHeaders();
@@ -81,7 +80,8 @@
                $self = $this->getTitle();
 
                $wgOut->addWikiMsg( 'linksearch-text', '<nowiki>' . 
$wgLang->commaList( $wgUrlProtocols ) . '</nowiki>' );
-               $s = Xml::openElement( 'form', array( 'id' => 
'mw-linksearch-form', 'method' => 'get', 'action' => $this->getFormAction() ) ) 
.
+               $s = Xml::openElement( 'form', array( 'id' => 
'mw-linksearch-form', 'method' => 'get', 'action' => $GLOBALS['wgScript'] ) ) .
+                       Html::hidden( 'title', $self->getPrefixedDbKey() ) .
                        '<fieldset>' .
                        Xml::element( 'legend', array(), wfMsg( 'linksearch' ) 
) .
                        Xml::inputLabel( wfMsg( 'linksearch-pat' ), 'target', 
'target', 50, $target ) . ' ';

Modified: branches/hashar/prettyURL/includes/specials/SpecialMIMEsearch.php
===================================================================
--- branches/hashar/prettyURL/includes/specials/SpecialMIMEsearch.php   
2011-03-24 18:39:30 UTC (rev 84693)
+++ branches/hashar/prettyURL/includes/specials/SpecialMIMEsearch.php   
2011-03-24 19:26:32 UTC (rev 84694)
@@ -65,8 +65,9 @@
                $this->setHeaders();
                $this->outputHeader();
                $wgOut->addHTML(
-                       Xml::openElement( 'form', array( 'id' => 
'specialmimesearch', 'method' => 'get', 'action' => $this->getFormAction() ) ) .
+                       Xml::openElement( 'form', array( 'id' => 
'specialmimesearch', 'method' => 'get', 'action' => SpecialPage::getTitleFor( 
'MIMEsearch' )->getLocalUrl() ) ) .
                        Xml::openElement( 'fieldset' ) .
+                       Html::hidden( 'title', SpecialPage::getTitleFor( 
'MIMEsearch' )->getPrefixedText() ) .
                        Xml::element( 'legend', null, wfMsg( 'mimesearch' ) ) .
                        Xml::inputLabel( wfMsg( 'mimetype' ), 'mime', 'mime', 
20, $mime ) . ' ' .
                        Xml::submitButton( wfMsg( 'ilsubmit' ) ) .

Modified: branches/hashar/prettyURL/includes/specials/SpecialMergeHistory.php
===================================================================
--- branches/hashar/prettyURL/includes/specials/SpecialMergeHistory.php 
2011-03-24 18:39:30 UTC (rev 84693)
+++ branches/hashar/prettyURL/includes/specials/SpecialMergeHistory.php 
2011-03-24 19:26:32 UTC (rev 84694)
@@ -131,17 +131,18 @@
        }
 
        function showMergeForm() {
-               global $wgOut ;
+               global $wgOut, $wgScript;
 
                $wgOut->addWikiMsg( 'mergehistory-header' );
 
                $wgOut->addHTML(
                        Xml::openElement( 'form', array(
                                'method' => 'get',
-                               'action' => $this->getFormAction() ) ) .
+                               'action' => $wgScript ) ) .
                        '<fieldset>' .
                        Xml::element( 'legend', array(),
                                wfMsg( 'mergehistory-box' ) ) .
+                       Html::hidden( 'title', 
$this->getTitle()->getPrefixedDbKey() ) .
                        Html::hidden( 'submitted', '1' ) .
                        Html::hidden( 'mergepoint', $this->mTimestamp ) .
                        Xml::openElement( 'table' ) .

Modified: branches/hashar/prettyURL/includes/specials/SpecialNewpages.php
===================================================================
--- branches/hashar/prettyURL/includes/specials/SpecialNewpages.php     
2011-03-24 18:39:30 UTC (rev 84693)
+++ branches/hashar/prettyURL/includes/specials/SpecialNewpages.php     
2011-03-24 19:26:32 UTC (rev 84694)
@@ -203,7 +203,7 @@
        }
 
        protected function form() {
-               global $wgOut, $wgEnableNewpagesUserFilter;
+               global $wgOut, $wgEnableNewpagesUserFilter, $wgScript;
 
                // Consume values
                $this->opts->consumeValue( 'offset' ); // don't carry offset, 
DWIW
@@ -227,7 +227,8 @@
                        list( $tagFilterLabel, $tagFilterSelector ) = 
$tagFilter;
                }
 
-               $form = Xml::openElement( 'form', array( 'action' => 
$this->getFormAction() ) ) .
+               $form = Xml::openElement( 'form', array( 'action' => $wgScript 
) ) .
+                       Html::hidden( 'title', 
$this->getTitle()->getPrefixedDBkey() ) .
                        Xml::fieldset( wfMsg( 'newpages' ) ) .
                        Xml::openElement( 'table', array( 'id' => 
'mw-newpages-table' ) ) .
                        '<tr>

Modified: branches/hashar/prettyURL/includes/specials/SpecialPrefixindex.php
===================================================================
--- branches/hashar/prettyURL/includes/specials/SpecialPrefixindex.php  
2011-03-24 18:39:30 UTC (rev 84693)
+++ branches/hashar/prettyURL/includes/specials/SpecialPrefixindex.php  
2011-03-24 19:26:32 UTC (rev 84694)
@@ -77,9 +77,12 @@
        * @param $from String: dbKey we are starting listing at.
        */
        function namespacePrefixForm( $namespace = NS_MAIN, $from = '' ) {
+               global $wgScript;
+               $t = $this->getTitle();
 
                $out  = Xml::openElement( 'div', array( 'class' => 
'namespaceoptions' ) );
-               $out .= Xml::openElement( 'form', array( 'method' => 'get', 
'action' => $this->getFormAction() ) );
+               $out .= Xml::openElement( 'form', array( 'method' => 'get', 
'action' => $wgScript ) );
+               $out .= Html::hidden( 'title', $t->getPrefixedText() );
                $out .= Xml::openElement( 'fieldset' );
                $out .= Xml::element( 'legend', null, wfMsg( 'allpages' ) );
                $out .= Xml::openElement( 'table', array( 'id' => 'nsselect', 
'class' => 'allpages' ) );

Modified: branches/hashar/prettyURL/includes/specials/SpecialProtectedpages.php
===================================================================
--- branches/hashar/prettyURL/includes/specials/SpecialProtectedpages.php       
2011-03-24 18:39:30 UTC (rev 84693)
+++ branches/hashar/prettyURL/includes/specials/SpecialProtectedpages.php       
2011-03-24 19:26:32 UTC (rev 84694)
@@ -159,9 +159,12 @@
         * @return String: input form
         */
        protected function showOptions( $namespace, $type='edit', $level, 
$sizetype, $size, $indefOnly, $cascadeOnly ) {
-               return Xml::openElement( 'form', array( 'method' => 'get', 
'action' => $this->getFormAction() ) ) .
+               global $wgScript;
+               $title = SpecialPage::getTitleFor( 'Protectedpages' );
+               return Xml::openElement( 'form', array( 'method' => 'get', 
'action' => $wgScript ) ) .
                        Xml::openElement( 'fieldset' ) .
                        Xml::element( 'legend', array(), wfMsg( 
'protectedpages' ) ) .
+                       Html::hidden( 'title', $title->getPrefixedDBkey() ) . 
"\n" .
                        $this->getNamespaceMenu( $namespace ) . "&#160;\n" .
                        $this->getTypeMenu( $type ) . "&#160;\n" .
                        $this->getLevelMenu( $level ) . "&#160;\n" .

Modified: branches/hashar/prettyURL/includes/specials/SpecialProtectedtitles.php
===================================================================
--- branches/hashar/prettyURL/includes/specials/SpecialProtectedtitles.php      
2011-03-24 18:39:30 UTC (rev 84693)
+++ branches/hashar/prettyURL/includes/specials/SpecialProtectedtitles.php      
2011-03-24 19:26:32 UTC (rev 84694)
@@ -112,10 +112,14 @@
         * @private
         */
        function showOptions( $namespace, $type='edit', $level ) {
-               # FIXME use Xml: or Html: methods to build the form
-               return "<form action=\"". $this->getFormAction()."\" 
method=\"get\">\n" .
+               global $wgScript;
+               $action = htmlspecialchars( $wgScript );
+               $title = SpecialPage::getTitleFor( 'Protectedtitles' );
+               $special = htmlspecialchars( $title->getPrefixedDBkey() );
+               return "<form action=\"$action\" method=\"get\">\n" .
                        '<fieldset>' .
                        Xml::element( 'legend', array(), wfMsg( 
'protectedtitles' ) ) .
+                       Html::hidden( 'title', $special ) . "&#160;\n" .
                        $this->getNamespaceMenu( $namespace ) . "&#160;\n" .
                        $this->getLevelMenu( $level ) . "&#160;\n" .
                        "&#160;" . Xml::submitButton( wfMsg( 'allpagessubmit' ) 
) . "\n" .

Modified: branches/hashar/prettyURL/includes/specials/SpecialRecentchanges.php
===================================================================
--- branches/hashar/prettyURL/includes/specials/SpecialRecentchanges.php        
2011-03-24 18:39:30 UTC (rev 84693)
+++ branches/hashar/prettyURL/includes/specials/SpecialRecentchanges.php        
2011-03-24 19:26:32 UTC (rev 84694)
@@ -510,7 +510,9 @@
                        $out .= Html::hidden( $key, $value );
                }
 
-               $form = Xml::tags( 'form', array( 'action' => 
$this->getFormAction() ), $out );
+               $t = $this->getTitle();
+               $out .= Html::hidden( 'title', $t->getPrefixedText() );
+               $form = Xml::tags( 'form', array( 'action' => $wgScript ), $out 
);
                $panel[] = $form;
                $panelString = implode( "\n", $panel );
 

Modified: branches/hashar/prettyURL/includes/specials/SpecialSearch.php
===================================================================
--- branches/hashar/prettyURL/includes/specials/SpecialSearch.php       
2011-03-24 18:39:30 UTC (rev 84693)
+++ branches/hashar/prettyURL/includes/specials/SpecialSearch.php       
2011-03-24 19:26:32 UTC (rev 84694)
@@ -218,7 +218,7 @@
                                array(
                                        'id' => ( $this->searchAdvanced ? 
'powersearch' : 'search' ),
                                        'method' => 'get',
-                                       'action' => $this->getFormAction(),
+                                       'action' => $wgScript
                                )
                        )
                );
@@ -836,6 +836,7 @@
                        $namespaceTables .
                        Xml::element( 'div', array( 'class' => 'divider' ), '', 
false ) .
                        $redirects .
+                       Html::hidden( 'title', SpecialPage::getTitleFor( 
'Search' )->getPrefixedText() ) .
                        Html::hidden( 'advanced', $this->searchAdvanced ) .
                        Html::hidden( 'fulltext', 'Advanced search' ) .
                        Xml::closeElement( 'fieldset' );
@@ -959,6 +960,8 @@
        }
 
        protected function shortDialog( $term ) {
+               $searchTitle = SpecialPage::getTitleFor( 'Search' );
+               $out = Html::hidden( 'title', $searchTitle->getPrefixedText() ) 
. "\n";
                // Keep redirect setting
                $out .= Html::hidden( "redirs", (int)$this->searchRedirects ) . 
"\n";
                // Term box

Modified: branches/hashar/prettyURL/includes/specials/SpecialUndelete.php
===================================================================
--- branches/hashar/prettyURL/includes/specials/SpecialUndelete.php     
2011-03-24 18:39:30 UTC (rev 84693)
+++ branches/hashar/prettyURL/includes/specials/SpecialUndelete.php     
2011-03-24 19:26:32 UTC (rev 84694)
@@ -718,15 +718,16 @@
        }
 
        function showSearchForm() {
-               global $wgOut;
+               global $wgOut, $wgScript;
                $wgOut->addWikiMsg( 'undelete-header' );
 
                $wgOut->addHTML(
                        Xml::openElement( 'form', array(
                                'method' => 'get',
-                               'action' => $this->getFormAction(),
-                               ) ) .
+                               'action' => $wgScript ) ) .
                        Xml::fieldset( wfMsg( 'undelete-search-box' ) ) .
+                       Html::hidden( 'title',
+                               $this->getTitle()->getPrefixedDbKey() ) .
                        Xml::inputLabel( wfMsg( 'undelete-search-prefix' ),
                                'prefix', 'prefix', 20,
                                $this->mSearchPrefix ) . ' ' .

Modified: branches/hashar/prettyURL/includes/specials/SpecialUserrights.php
===================================================================
--- branches/hashar/prettyURL/includes/specials/SpecialUserrights.php   
2011-03-24 18:39:30 UTC (rev 84693)
+++ branches/hashar/prettyURL/includes/specials/SpecialUserrights.php   
2011-03-24 19:26:32 UTC (rev 84694)
@@ -372,14 +372,10 @@
         * Output a form to allow searching for a user
         */
        function switchForm() {
-               global $wgOut;
+               global $wgOut, $wgScript;
                $wgOut->addHTML(
-                       Html::openElement( 'form', array(
-                               'action' => $this->getFormAction(),
-                               'id' => 'mw-userrights-form1',
-                               'method' => 'get',
-                               'name' => 'uluser',
-                               ) ) .
+                       Html::openElement( 'form', array( 'method' => 'get', 
'action' => $wgScript, 'name' => 'uluser', 'id' => 'mw-userrights-form1' ) ) .
+                       Html::hidden( 'title',  
$this->getTitle()->getPrefixedText() ) .
                        Xml::fieldset( wfMsg( 'userrights-lookup-user' ) ) .
                        Xml::inputLabel( wfMsg( 'userrights-user-editname' ), 
'user', 'username', 30, str_replace( '_', ' ', $this->mTarget ) ) . ' ' .
                        Xml::submitButton( wfMsg( 'editusergroup' ) ) .
@@ -442,12 +438,7 @@
                        $grouplist .= '<p>' . $autogrouplistintro  . ' ' . 
$wgLang->listToText( $autolist ) . "</p>\n";
                }
                $wgOut->addHTML(
-                       Xml::openElement( 'form', array(
-                               'action' => $this->getFormAction(),
-                               'id' => 'mw-userrights-form2',
-                               'method' => 'post',
-                               'name' => 'editGroup',
-                       ) ) .
+                       Xml::openElement( 'form', array( 'method' => 'post', 
'action' => $this->getTitle()->getLocalURL(), 'name' => 'editGroup', 'id' => 
'mw-userrights-form2' ) ) .
                        Html::hidden( 'user', $this->mTarget ) .
                        Html::hidden( 'wpEditToken', $wgUser->editToken( 
$this->mTarget ) ) .
                        Xml::openElement( 'fieldset' ) .

Modified: branches/hashar/prettyURL/includes/specials/SpecialWhatlinkshere.php
===================================================================
--- branches/hashar/prettyURL/includes/specials/SpecialWhatlinkshere.php        
2011-03-24 18:39:30 UTC (rev 84693)
+++ branches/hashar/prettyURL/includes/specials/SpecialWhatlinkshere.php        
2011-03-24 19:26:32 UTC (rev 84694)
@@ -380,9 +380,10 @@
                $namespace = $this->opts->consumeValue( 'namespace' );
 
                # Build up the form
-               $f = Xml::openElement( 'form', array( 'action' => 
$this->getFormAction() ) );
+               $f = Xml::openElement( 'form', array( 'action' => $wgScript ) );
 
                # Values that should not be forgotten
+               $f .= Html::hidden( 'title', 
$this->getTitle()->getPrefixedText() );
                foreach ( $this->opts->getUnconsumedValues() as $name => $value 
) {
                        $f .= Html::hidden( $name, $value );
                }

Modified: 
branches/hashar/prettyURL/includes/specials/SpecialWithoutinterwiki.php
===================================================================
--- branches/hashar/prettyURL/includes/specials/SpecialWithoutinterwiki.php     
2011-03-24 18:39:30 UTC (rev 84693)
+++ branches/hashar/prettyURL/includes/specials/SpecialWithoutinterwiki.php     
2011-03-24 19:26:32 UTC (rev 84694)
@@ -41,7 +41,7 @@
        }
 
        function getPageHeader() {
-               global $wgMiserMode;
+               global $wgScript, $wgMiserMode;
 
                # Do not show useless input form if wiki is running in misermode
                if( $wgMiserMode ) {
@@ -49,10 +49,12 @@
                }
 
                $prefix = $this->prefix;
+               $t = SpecialPage::getTitleFor( $this->getName() );
 
-               return  Xml::openElement( 'form', array( 'method' => 'get', 
'action' => $this->getFormAction() ) ) .
+               return  Xml::openElement( 'form', array( 'method' => 'get', 
'action' => $wgScript ) ) .
                        Xml::openElement( 'fieldset' ) .
                        Xml::element( 'legend', null, wfMsg( 
'withoutinterwiki-legend' ) ) .
+                       Html::hidden( 'title', $t->getPrefixedText() ) .
                        Xml::inputLabel( wfMsg( 'allpagesprefix' ), 'prefix', 
'wiprefix', 20, $prefix ) . ' ' .
                        Xml::submitButton( wfMsg( 'withoutinterwiki-submit' ) ) 
.
                        Xml::closeElement( 'fieldset' ) .


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to