-
Notifications
You must be signed in to change notification settings - Fork 88
Open
Description
Php 8.1 issues a deprecation warning when sending an email. This is because of FILTER_SANITIZE_STRING in filterName().
// OLD
public function filterName($name)
{
$rule = array(
"\r" => '',
"\n" => '',
"\t" => '',
'"' => "'",
'<' => '[',
'>' => ']',
);
$filtered = filter_var(
$name,
FILTER_SANITIZE_STRING,
FILTER_FLAG_NO_ENCODE_QUOTES
);
return trim(strtr($filtered, $rule));
}Changing this function to below solves this:
// CHANGED
public function filterName($name)
{
$rule = array(
"\r" => '',
"\n" => '',
"\t" => '',
'"' => "'",
'<' => '[',
'>' => ']',
);
$filtered = filter_var(
$name,
FILTER_UNSAFE_RAW,
FILTER_FLAG_STRIP_LOW
);
return trim(strtr($filtered, $rule));
}P.S. Sorry, I am unable to provide a PR.
Metadata
Metadata
Assignees
Labels
No labels