CRM_Utils_Verp
in package
Class to handle encoding and decoding Variable Enveleope Return Path (VERP) headers.
Tags
Table of Contents
Properties
- $decodeMap : array<string|int, mixed>
- Mapping of hex codes to reserved characters
- $encodeMap : array<string|int, mixed>
- Mapping of reserved characters to hex codes
Methods
- encode() : string
- Encode the sender's address with the VERPed recipient.
- verpdecode() : array<string|int, mixed>
- Decode the address and return the sender and recipient as an array.
Properties
$decodeMap
Mapping of hex codes to reserved characters
public
static array<string|int, mixed>
$decodeMap
= ['40' => '@', '3A' => ':', '25' => '%', '21' => '!', '2D' => '-', '5B' => '[', '5D' => ']', '2B' => '+']
$encodeMap
Mapping of reserved characters to hex codes
public
static array<string|int, mixed>
$encodeMap
= ['+' => '2B', '@' => '40', ':' => '3A', '%' => '25', '!' => '21', '-' => '2D', '[' => '5B', ']' => '5D']
Methods
encode()
Encode the sender's address with the VERPed recipient.
public
static encode(string $sender, string $recipient) : string
Parameters
- $sender : string
-
The address of the sender.
- $recipient : string
-
The address of the recipient.
Return values
string —The VERP encoded address
verpdecode()
Decode the address and return the sender and recipient as an array.
public
static & verpdecode(string $address) : array<string|int, mixed>
Parameters
- $address : string
-
The address to be decoded.
Return values
array<string|int, mixed> —The tuple ($sender, $recipient)