r91213 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91212‎ | r91213 | r91214 >
Date:19:58, 30 June 2011
Author:foxtrott
Status:deferred
Tags:
Comment:
bugfix: reset wgRequest to old value before leaving method
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_AutoEditAjaxHandler.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_AutoEditAjaxHandler.php
@@ -123,6 +123,7 @@
124124
125125 if ( !$form ) {
126126 // something went wrong
 127+ $wgRequest = $oldRequest;
127128 return array(
128129 'autoedit-nosemanticform',
129130 array(
@@ -151,19 +152,18 @@
152153
153154 $wgParser->getOptions()->enableLimitReport( false );
154155
 156+ $wgRequest = $oldRequest;
 157+
155158 if ( $formedit->mError ) {
156 - // TODO Should this be sanitized? i.e. all HTML tags removed?
157 - $msg = $formedit->mError;
158159
159160 $msg = $wgParser->parse(
160 - wfMsgReplaceArgs( $this->mOptions['error text'], array( $msg ) ),
 161+ wfMsgReplaceArgs( $this->mOptions['error text'], array( $formedit->mError ) ),
161162 $wgTitle,
162163 $wgParser->getOptions()
163164 )->getText();
164165
165166 $result = new AjaxResponse( $msg );
166167 $result->setResponseCode( '400 Bad Request' );
167 - return $result;
168168 } else {
169169
170170 header( "X-Location: " . $wgOut->getRedirect() );
@@ -173,8 +173,9 @@
174174 $msg = $wgParser->recursiveTagParse( wfMsgReplaceArgs( $this->mOptions['ok text'], array( $formedit->mTarget, $formedit->mForm ) ) );
175175
176176 $result = new AjaxResponse( $msg );
177 - return $result;
178177 }
 178+
 179+ return $result;
179180 }
180181
181182 private function parseDataFromHTMLFrag ( &$data, $html, $formID ) {