Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Static Public Member Functions
Zend_Mail_Header_HeaderName Class Reference

Static Public Member Functions

static filter ($name)
 
static isValid ($name)
 
static assertValid ($name)
 

Detailed Description

Definition at line 29 of file HeaderName.php.

Member Function Documentation

◆ assertValid()

static assertValid (   $name)
static

Assert that the header name is valid.

Raises an exception if invalid.

Parameters
string$name
Exceptions
Exception

Definition at line 85 of file HeaderName.php.

86  {
87  if (! self::isValid($name)) {
88  #require_once 'Zend/Mail/Exception.php';
89  throw new Zend_Mail_Exception('Invalid header name detected');
90  }
91  }
if(!isset($_GET['name'])) $name
Definition: log.php:14

◆ filter()

static filter (   $name)
static

Filter the header name according to RFC 2822

See also
http://www.rfc-base.org/txt/rfc-2822.txt (section 2.2)
Parameters
string$name
Returns
string

Definition at line 45 of file HeaderName.php.

46  {
47  $result = '';
48  $tot = strlen($name);
49  for ($i = 0; $i < $tot; $i += 1) {
50  $ord = ord($name[$i]);
51  if ($ord > 32 && $ord < 127 && $ord !== 58) {
52  $result .= $name[$i];
53  }
54  }
55  return $result;
56  }
$i
Definition: gallery.phtml:31
if(!isset($_GET['name'])) $name
Definition: log.php:14

◆ isValid()

static isValid (   $name)
static

Determine if the header name contains any invalid characters.

Parameters
string$name
Returns
bool

Definition at line 64 of file HeaderName.php.

65  {
66  $tot = strlen($name);
67  for ($i = 0; $i < $tot; $i += 1) {
68  $ord = ord($name[$i]);
69  if ($ord < 33 || $ord > 126 || $ord === 58) {
70  return false;
71  }
72  }
73  return true;
74  }
$i
Definition: gallery.phtml:31
if(!isset($_GET['name'])) $name
Definition: log.php:14

The documentation for this class was generated from the following file: