You are here

public function PHPMailer::SecureHeader in SMTP Authentication Support 7

Same name and namespace in other branches
  1. 7.2 smtp.phpmailer.inc \PHPMailer::SecureHeader()

Strips newlines to prevent header injection. @access public

Parameters

string $str String:

Return value

string

4 calls to PHPMailer::SecureHeader()
PHPMailer::AddrFormat in ./smtp.phpmailer.inc
Formats an address correctly. @access public
PHPMailer::AttachAll in ./smtp.phpmailer.inc
Attaches all fs, string, and binary attachments to the message. Returns an empty string on failure. @access private
PHPMailer::CreateHeader in ./smtp.phpmailer.inc
Assembles message header. @access public
PHPMailer::MailSend in ./smtp.phpmailer.inc
Sends mail using the PHP mail() function.

File

./smtp.phpmailer.inc, line 2178
The mail handler class in smtp module, based on code of the phpmailer library, customized and relicensed to GPLv2.

Class

PHPMailer
PHPMailer - PHP email transport class NOTE: Requires PHP version 5 or later @package PHPMailer @author Andy Prevost @author Marcus Bointon @copyright 2004 - 2009 Andy Prevost

Code

public function SecureHeader($str) {
  $str = str_replace("\r", '', $str);
  $str = str_replace("\n", '', $str);
  return trim($str);
}