| 1 |
<?php |
| 2 |
|
| 3 |
include_once dirname( __FILE__ ) . '/http-header.php'; |
| 4 |
|
| 5 |
class Cookie_Match extends Header_Match { |
| 6 |
public function name() { |
| 7 |
return __( 'URL and cookie', 'redirection' ); |
| 8 |
} |
| 9 |
|
| 10 |
public function is_match( $url ) { |
| 11 |
if ( $this->regex ) { |
| 12 |
$regex = new Red_Regex( $this->value, true ); |
| 13 |
return $regex->is_match( Redirection_Request::get_cookie( $this->name ) ); |
| 14 |
} |
| 15 |
|
| 16 |
return Redirection_Request::get_cookie( $this->name ) === $this->value; |
| 17 |
} |
| 18 |
} |
| 19 |
|