static public encode_mime_header ( $string ) : string | ||
$string | string Input MIME header to encode. | |
Результат | string | Encoded MIME header. |
/** * Encode a display name for proper inclusion with an email address. * @param $displayName string * @param $send boolean True to encode the results for sending * @return string */ function encodeDisplayName($displayName, $send = false) { if (PKPString::regexp_match('!^[-A-Za-z0-9\\!#\\$%&\'\\*\\+\\/=\\?\\^_\\`\\{\\|\\}~]+$!', $displayName)) { return $displayName; } return '"' . ($send ? PKPString::encode_mime_header(str_replace(array('"', '\\'), '', $displayName)) : str_replace(array('"', '\\'), '', $displayName)) . '"'; }