From 8ed070b3dc626a491a189cefaf0fac4781553f9d Mon Sep 17 00:00:00 2001 From: Alex Z Date: Thu, 23 Oct 2008 20:44:56 +0000 Subject: [PATCH] Cleanup for purge form: *(bug 8992) Use $wgRequest instead of $_SERVER (patch by Andrea Matsunaga) *Valid XHTML and less strange message usage. --- RELEASE-NOTES | 1 + includes/Article.php | 17 ++++++++--------- languages/messages/MessagesEn.php | 5 ++--- maintenance/language/messages.inc | 3 ++- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 1a0920139e..7581604f00 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/Article.php b/includes/Article.php index 97aebd6bb9..33c74aacf5 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -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', - "
\n" . - "\n" . - "
\n", $msg ); - + $action = htmlspecialchars( $wgRequest->getRequestURL() ); + $button = wfMsgExt( 'confirm_purge_button', array('escapenoentities') ); + $form = "
\n" . + "\n" . + "
\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 ); } } diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 16c6e0fb1d..599ca0f73a 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -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 diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 5d64095479..9a85be50f7 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -2620,8 +2620,9 @@ $wgMessageStructure = array( 'unit-pixel', ), 'purge' => array( - 'confirm_purge', 'confirm_purge_button', + 'confirm-purge-top', + 'confirm-purge-bottom', ), 'separators' => array( 'catseparator', -- 2.20.1