Cleanup for purge form:
authorAlex Z <mrzman@users.mediawiki.org>
Thu, 23 Oct 2008 20:44:56 +0000 (20:44 +0000)
committerAlex Z <mrzman@users.mediawiki.org>
Thu, 23 Oct 2008 20:44:56 +0000 (20:44 +0000)
*(bug 8992) Use $wgRequest instead of $_SERVER (patch by Andrea Matsunaga)
*Valid XHTML and less strange message usage.

RELEASE-NOTES
includes/Article.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index 1a09201..7581604 100644 (file)
@@ -281,6 +281,7 @@ The following extensions are migrated into MediaWiki 1.14:
 * (bug 13701) {{NUMBEROFVIEWS}} magic word to show number of total views.
 * (bug 5101) Image from Commons doesn't show up when searched in Wikipedia search box
 * (bug 14609) User's namespaces to be searched default not updated after adding new namespace
+* Purge form uses valid XHTML and (bug 8992) uses $wgRequest instead of $_SERVER
 
 === API changes in 1.14 ===
 
index 97aebd6..33c74aa 100644 (file)
@@ -1075,17 +1075,16 @@ class Article {
                                $this->view();
                        }
                } else {
-                       $msg = $wgOut->parse( wfMsg( 'confirm_purge' ) );
-                       $action = htmlspecialchars( $_SERVER['REQUEST_URI'] );
-                       $button = htmlspecialchars( wfMsg( 'confirm_purge_button' ) );
-                       $msg = str_replace( '$1',
-                               "<form method=\"post\" action=\"$action\">\n" .
-                               "<input type=\"submit\" name=\"submit\" value=\"$button\" />\n" .
-                               "</form>\n", $msg );
-
+                       $action = htmlspecialchars( $wgRequest->getRequestURL() );
+                       $button = wfMsgExt( 'confirm_purge_button', array('escapenoentities') );
+                       $form = "<form method=\"post\" action=\"$action\">\n" .
+                                       "<input type=\"submit\" name=\"submit\" value=\"$button\" />\n" .
+                                       "</form>\n";
+                       $top = wfMsgExt( 'confirm-purge-top', array('parse') );
+                       $bottom = wfMsgExt( 'confirm-purge-bottom', array('parse') );
                        $wgOut->setPageTitle( $this->mTitle->getPrefixedText() );
                        $wgOut->setRobotPolicy( 'noindex,nofollow' );
-                       $wgOut->addHTML( $msg );
+                       $wgOut->addHTML( $top . $form . $bottom );
                }
        }
 
index 16c6e0f..599ca0f 100644 (file)
@@ -3491,10 +3491,9 @@ Please confirm that you really want to recreate this page.",
 'unit-pixel' => 'px', # only translate this message to other languages if you have to change it
 
 # action=purge
-'confirm_purge'        => 'Clear the cache of this page?
-
-$1',
 'confirm_purge_button' => 'OK',
+'confirm-purge-top'    => 'Clear the cache of this page?',
+'confirm-purge-bottom' => 'Purging a page clears the cache and forces the most current version to appear.',
 
 # Separators for various lists, etc.
 'catseparator'        => '|', # only translate this message to other languages if you have to change it
index 5d64095..9a85be5 100644 (file)
@@ -2620,8 +2620,9 @@ $wgMessageStructure = array(
                'unit-pixel',
        ),
        'purge' => array(
-               'confirm_purge',
                'confirm_purge_button',
+               'confirm-purge-top',
+               'confirm-purge-bottom',
        ),
        'separators' => array(
                'catseparator',