r45818 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45817‎ | r45818 | r45819 >
Date:23:01, 16 January 2009
Author:werdna
Status:deferred
Tags:
Comment:
Use a 302 to redirect to a success page, which is just a message at the top of the normal page, rather than using it as the result of a POST.

Less chance of doing and redoing things.
Modified paths:
  • /branches/change-tagging/extensions/AbuseFilter/AbuseFilter.i18n.php (modified) (history)
  • /branches/change-tagging/extensions/AbuseFilter/SpecialAbuseFilter.php (modified) (history)

Diff [purge]

Index: branches/change-tagging/extensions/AbuseFilter/SpecialAbuseFilter.php
@@ -32,6 +32,11 @@
3333 $this->displayRestrictionError();
3434 return;
3535 }
 36+
 37+ if ( $wgRequest->getVal( 'result' ) == 'success' ) {
 38+ $wgOut->setSubtitle( wfMsg( 'abusefilter-edit-done-subtitle' ) );
 39+ $wgOut->wrapWikiMsg( '<p class="success">$1</p>', array('abusefilter-edit-done', $wgRequest->getVal( 'changedfilter' ) ) );
 40+ }
3641
3742 $this->mSkin = $wgUser->getSkin();
3843
@@ -318,8 +323,7 @@
319324
320325 global $wgOut;
321326
322 - $wgOut->setSubtitle( wfMsg('abusefilter-edit-done-subtitle' ) );
323 - return wfMsgExt( 'abusefilter-edit-done', array( 'parse' ) );
 327+ $wgOut->redirect( $this->getTitle()->getLocalURL( 'result=success&changedfilter='.$new_id ) );
324328 } else {
325329 return $this->buildFilterEditor( null, $filter, $history_id );
326330 }
Index: branches/change-tagging/extensions/AbuseFilter/AbuseFilter.i18n.php
@@ -159,7 +159,7 @@
160160 'abusefilter-edit-denied' => "You may not view details of this filter, because it is hidden from public view",
161161 'abusefilter-edit-main' => 'Filter parameters',
162162 'abusefilter-edit-done-subtitle' => 'Filter edited',
163 - 'abusefilter-edit-done' => "You have successfully saved your changes to the filter.\n\n[[Special:AbuseFilter|Return]]",
 163+ 'abusefilter-edit-done' => "You have successfully saved your changes to filter $1.",
164164 'abusefilter-edit-badsyntax' => "There is a syntax error in the filter you specified. The output from the parser was: <pre>$1</pre>",
165165 'abusefilter-edit-viewhistory' => "View this filter's history",
166166 'abusefilter-edit-history' => 'History',

Status & tagging log