Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
zendframework1
library
Zend
Mail
Header
HeaderValue.php
Go to the documentation of this file.
1
<?php
29
final
class
Zend_Mail_Header_HeaderValue
30
{
34
private
function
__construct()
35
{
36
}
37
45
public
static
function
filter
(
$value
)
46
{
47
$result
=
''
;
48
$tot = strlen(
$value
);
49
50
// Filter for CR and LF characters, leaving CRLF + WSP sequences for
51
// Long Header Fields (section 2.2.3 of RFC 2822)
52
for
(
$i
= 0;
$i
< $tot;
$i
+= 1) {
53
$ord = ord(
$value
[
$i
]);
54
if
(($ord < 32 || $ord > 126)
55
&& $ord !== 13
56
) {
57
continue
;
58
}
59
60
if
($ord === 13) {
61
if
(
$i
+ 2 >= $tot) {
62
continue
;
63
}
64
65
$lf = ord(
$value
[
$i
+ 1]);
66
$sp = ord(
$value
[
$i
+ 2]);
67
68
if
($lf !== 10 || $sp !== 32) {
69
continue
;
70
}
71
72
$result
.=
"\r\n "
;
73
$i
+= 2;
74
continue
;
75
}
76
77
$result
.=
$value
[
$i
];
78
}
79
80
return
$result
;
81
}
82
90
public
static
function
isValid
(
$value
)
91
{
92
$tot = strlen(
$value
);
93
for
(
$i
= 0;
$i
< $tot;
$i
+= 1) {
94
$ord = ord(
$value
[
$i
]);
95
if
(($ord < 32 || $ord > 126)
96
&& $ord !== 13
97
) {
98
return
false
;
99
}
100
101
if
($ord === 13) {
102
if
(
$i
+ 2 >= $tot) {
103
return
false
;
104
}
105
106
$lf = ord(
$value
[
$i
+ 1]);
107
$sp = ord(
$value
[
$i
+ 2]);
108
109
if
($lf !== 10 || $sp !== 32) {
110
return
false
;
111
}
112
113
$i
+= 2;
114
}
115
}
116
117
return
true
;
118
}
119
129
public
static
function
assertValid
(
$value
)
130
{
131
if
(! self::isValid(
$value
)) {
132
#require_once 'Zend/Mail/Exception.php';
133
throw
new
Zend_Mail_Exception
(
'Invalid header value detected'
);
134
}
135
}
136
}
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
Zend_Mail_Header_HeaderValue\filter
static filter($value)
Definition:
HeaderValue.php:45
Zend_Mail_Exception
Definition:
Exception.php:35
$value
$value
Definition:
gender.phtml:16
Zend_Mail_Header_HeaderValue
Definition:
HeaderValue.php:29
Zend_Mail_Header_HeaderValue\assertValid
static assertValid($value)
Definition:
HeaderValue.php:129
Zend_Mail_Header_HeaderValue\isValid
static isValid($value)
Definition:
HeaderValue.php:90
$i
$i
Definition:
gallery.phtml:31