PluginProbe
Redirection / 4.5
Redirection v4.5
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 4.5, at matches/cookie.php

19 lines 454 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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