Index: trunk/phase3/includes/WebRequest.php |
— | — | @@ -379,7 +379,24 @@ |
380 | 380 | return $ret; |
381 | 381 | } |
382 | 382 | |
| 383 | + |
383 | 384 | /** |
| 385 | + * Unset an arbitrary value from our get/post data. |
| 386 | + * |
| 387 | + * @param $key String: key name to use |
| 388 | + * @return Mixed: old value if one was present, null otherwise |
| 389 | + */ |
| 390 | + public function unsetVal( $key ) { |
| 391 | + if ( !isset( $this->data[$key] ) ) { |
| 392 | + $ret = null; |
| 393 | + } else { |
| 394 | + $ret = $this->data[$key]; |
| 395 | + unset( $this->data[$key] ); |
| 396 | + } |
| 397 | + return $ret; |
| 398 | + } |
| 399 | + |
| 400 | + /** |
384 | 401 | * Fetch an array from the input or return $default if it's not set. |
385 | 402 | * If source was scalar, will return an array with a single element. |
386 | 403 | * If no source and no default, returns NULL. |