PluginProbe
Redirection / 5.3.3
Redirection v5.3.3
5.10.0 5.9.0 5.8.1 5.8.0 3.7.2 3.7.3 4.0 4.0.1 4.1 4.1.1 4.2 4.2.1 4.2.2 4.2.3 4.3 4.3.1 4.3.2 4.3.3 4.4 4.4.1 4.4.2 4.5 4.5.1 4.6.2 4.7.1 All 130 releases
redirection / matches / cookie.php

cookie.php in Redirection 5.3.3, at matches/cookie.php

22 lines 498 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 require_once dirname( __FILE__ ) . '/http-header.php';
4
5 /**
6 * Check that a cookie value exists
7 */
8 class Cookie_Match extends Header_Match {
9 public function name() {
10 return __( 'URL and cookie', 'redirection' );
11 }
12
13 public function is_match( $url ) {
14 if ( $this->regex ) {
15 $regex = new Red_Regex( $this->value, true );
16 return $regex->is_match( Redirection_Request::get_cookie( $this->name ) );
17 }
18
19 return Redirection_Request::get_cookie( $this->name ) === $this->value;
20 }
21 }
22