HEX
Server: Apache
System: Linux sg2plmcpnl507963.prod.sin2.secureserver.net 4.18.0-553.52.1.lve.el8.x86_64 #1 SMP Wed May 21 15:31:29 UTC 2025 x86_64
User: lsqdoer4f1j9 (9817645)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: /home/lsqdoer4f1j9/public_html/vbetind.com/wp-content/plugins/redirection/matches/cookie.php
<?php

require_once __DIR__ . '/http-header.php';

/**
 * Check that a cookie value exists
 */
class Cookie_Match extends Header_Match {
	public function name() {
		return __( 'URL and cookie', 'redirection' );
	}

	public function is_match( $url ) {
		if ( $this->regex ) {
			$regex = new Red_Regex( $this->value, true );
			$cookie = Redirection_Request::get_cookie( $this->name );
			if ( $cookie === false ) {
				return false;
			}

			return $regex->is_match( $cookie );
		}

		return Redirection_Request::get_cookie( $this->name ) === $this->value;
	}
}