Index: trunk/extensions/SemanticForms/includes/SF_AutoEditAjaxHandler.php |
— | — | @@ -123,6 +123,7 @@ |
124 | 124 | |
125 | 125 | if ( !$form ) { |
126 | 126 | // something went wrong |
| 127 | + $wgRequest = $oldRequest; |
127 | 128 | return array( |
128 | 129 | 'autoedit-nosemanticform', |
129 | 130 | array( |
— | — | @@ -151,19 +152,18 @@ |
152 | 153 | |
153 | 154 | $wgParser->getOptions()->enableLimitReport( false ); |
154 | 155 | |
| 156 | + $wgRequest = $oldRequest; |
| 157 | + |
155 | 158 | if ( $formedit->mError ) { |
156 | | - // TODO Should this be sanitized? i.e. all HTML tags removed? |
157 | | - $msg = $formedit->mError; |
158 | 159 | |
159 | 160 | $msg = $wgParser->parse( |
160 | | - wfMsgReplaceArgs( $this->mOptions['error text'], array( $msg ) ), |
| 161 | + wfMsgReplaceArgs( $this->mOptions['error text'], array( $formedit->mError ) ), |
161 | 162 | $wgTitle, |
162 | 163 | $wgParser->getOptions() |
163 | 164 | )->getText(); |
164 | 165 | |
165 | 166 | $result = new AjaxResponse( $msg ); |
166 | 167 | $result->setResponseCode( '400 Bad Request' ); |
167 | | - return $result; |
168 | 168 | } else { |
169 | 169 | |
170 | 170 | header( "X-Location: " . $wgOut->getRedirect() ); |
— | — | @@ -173,8 +173,9 @@ |
174 | 174 | $msg = $wgParser->recursiveTagParse( wfMsgReplaceArgs( $this->mOptions['ok text'], array( $formedit->mTarget, $formedit->mForm ) ) ); |
175 | 175 | |
176 | 176 | $result = new AjaxResponse( $msg ); |
177 | | - return $result; |
178 | 177 | } |
| 178 | + |
| 179 | + return $result; |
179 | 180 | } |
180 | 181 | |
181 | 182 | private function parseDataFromHTMLFrag ( &$data, $html, $formID ) { |