Index: trunk/phase3/includes/api/ApiEditPage.php |
— | — | @@ -136,9 +136,9 @@ |
137 | 137 | # Handle CAPTCHA parameters |
138 | 138 | global $wgRequest; |
139 | 139 | if(isset($params['captchaid'])) |
140 | | - $wgRequest->data['wpCaptchaId'] = $params['captchaid']; |
| 140 | + $wgRequest->setVal( 'wpCaptchaId' ) = $params['captchaid']; |
141 | 141 | if(isset($params['captchaword'])) |
142 | | - $wgRequest->data['wpCaptchaWord'] = $params['captchaword']; |
| 142 | + $wgRequest->setVal( 'wpCaptchaWord' ) = $params['captchaword']; |
143 | 143 | $r = array(); |
144 | 144 | if(!wfRunHooks('APIEditBeforeSave', array(&$ep, $ep->textbox1, &$r))) |
145 | 145 | { |
Index: trunk/phase3/includes/WebRequest.php |
— | — | @@ -256,6 +256,18 @@ |
257 | 257 | return (string)$val; |
258 | 258 | } |
259 | 259 | } |
| 260 | + |
| 261 | + /** |
| 262 | + * Set an aribtrary value into our get/post data. |
| 263 | + * @param $key string Key name to use |
| 264 | + * @param $value mixed Value to set |
| 265 | + * @return mixed old value if one was present, null otherwise |
| 266 | + */ |
| 267 | + function setVal( $key, $value ) { |
| 268 | + $ret = isset( $this->data[$key] ) ? $this->data[$key] : null; |
| 269 | + $this->data[$key] = $value; |
| 270 | + return $ret; |
| 271 | + } |
260 | 272 | |
261 | 273 | /** |
262 | 274 | * Fetch an array from the input or return $default if it's not set. |