Index: trunk/phase3/includes/WebRequest.php |
— | — | @@ -432,6 +432,21 @@ |
433 | 433 | } |
434 | 434 | |
435 | 435 | /** |
| 436 | + * Get a cookie from the $_COOKIE jar |
| 437 | + * @param String $key The name of the cookie |
| 438 | + * @param mixed $default What to return if the value isn't found |
| 439 | + * @param String $prefix A prefix to use for the cookie name, if not $wgCookiePrefix |
| 440 | + * @return <type> |
| 441 | + */ |
| 442 | + public function getCookie( $key, $default = null, $prefix = '' ) { |
| 443 | + if( !$prefix ) { |
| 444 | + global $wgCookiePrefix; |
| 445 | + $prefix = $wgCookiePrefix; |
| 446 | + } |
| 447 | + return $this->getGPCVal( $_COOKIE, $prefix . $key , $default ); |
| 448 | + } |
| 449 | + |
| 450 | + /** |
436 | 451 | * Return the path portion of the request URI. |
437 | 452 | * @return string |
438 | 453 | */ |