r38726 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r38725‎ | r38726 | r38727 >
Date:17:11, 6 August 2008
Author:yaron
Status:old
Tags:
Comment:
Added title as a hidden field in the various forms
Modified paths:
  • /trunk/extensions/ReplaceText/SpecialReplaceText.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ReplaceText/SpecialReplaceText.php
@@ -18,7 +18,7 @@
1919 }
2020
2121 function displayConfirmForm($message) {
22 - global $wgRequest;
 22+ global $wgRequest, $wgContLang;
2323 $target_str = $wgRequest->getVal('target_str');
2424 $replacement_str = $wgRequest->getVal('replacement_str');
2525 // escape quotes for inclusion in HTML
@@ -26,8 +26,12 @@
2727 $replacement_str = str_replace('"', '"', $replacement_str);
2828 $continue_label = wfMsg('replacetext_continue');
2929 $cancel_label = wfMsg('replacetext_cancel');
 30+ // set 'title' as hidden field, in case there's no URL niceness
 31+ $mw_namespace_labels = $wgContLang->getNamespaces();
 32+ $special_namespace = $mw_namespace_labels[NS_SPECIAL];
3033 $text =<<<END
3134 <form method="post" action="">
 35+ <input type="hidden" name="title" value="$special_namespace:ReplaceText">
3236 <input type="hidden" name="target_str" value="$target_str">
3337 <input type="hidden" name="replacement_str" value="$replacement_str">
3438 <p>$message</p>
@@ -43,6 +47,10 @@
4448 function doSpecialReplaceText() {
4549 global $wgUser, $wgOut, $wgRequest, $wgContLang;
4650
 51+ // set 'title' as hidden field, in case there's no URL niceness
 52+ $mw_namespace_labels = $wgContLang->getNamespaces();
 53+ $special_namespace = $mw_namespace_labels[NS_SPECIAL];
 54+
4755 if ($wgRequest->getCheck('replace')) {
4856 $target_str = $wgRequest->getVal('target_str');
4957 $replacement_str = $wgRequest->getVal('replacement_str');
@@ -170,6 +178,7 @@
171179 $text =<<<END
172180 <p>$choose_pages_label</p>
173181 <form id="choose_pages" method="post">
 182+ <input type="hidden" name="title" value="$special_namespace:ReplaceText">
174183 <input type="hidden" name="target_str" value="$target_str">
175184 <input type="hidden" name="replacement_str" value="$replacement_str">
176185
@@ -195,6 +204,7 @@
196205 $continue_label = wfMsg('replacetext_continue');
197206 $text =<<<END
198207 <form method="get" action="">
 208+ <input type="hidden" name="title" value="$special_namespace:ReplaceText">
199209 <p>$replacement_label</p>
200210 <p>$replacement_note</p>
201211 <table>

Status & tagging log