Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu.../PHPMaile...
File: PHPMailer.php
'from',
[5000] Fix | Delete
'to',
[5001] Fix | Delete
'cc',
[5002] Fix | Delete
'date',
[5003] Fix | Delete
'subject',
[5004] Fix | Delete
'reply-to',
[5005] Fix | Delete
'message-id',
[5006] Fix | Delete
'content-type',
[5007] Fix | Delete
'mime-version',
[5008] Fix | Delete
'x-mailer',
[5009] Fix | Delete
];
[5010] Fix | Delete
if (stripos($headers_line, 'Subject') === false) {
[5011] Fix | Delete
$headers_line .= 'Subject: ' . $subject . static::$LE;
[5012] Fix | Delete
}
[5013] Fix | Delete
$headerLines = explode(static::$LE, $headers_line);
[5014] Fix | Delete
$currentHeaderLabel = '';
[5015] Fix | Delete
$currentHeaderValue = '';
[5016] Fix | Delete
$parsedHeaders = [];
[5017] Fix | Delete
$headerLineIndex = 0;
[5018] Fix | Delete
$headerLineCount = count($headerLines);
[5019] Fix | Delete
foreach ($headerLines as $headerLine) {
[5020] Fix | Delete
$matches = [];
[5021] Fix | Delete
if (preg_match('/^([^ \t]*?)(?::[ \t]*)(.*)$/', $headerLine, $matches)) {
[5022] Fix | Delete
if ($currentHeaderLabel !== '') {
[5023] Fix | Delete
//We were previously in another header; This is the start of a new header, so save the previous one
[5024] Fix | Delete
$parsedHeaders[] = ['label' => $currentHeaderLabel, 'value' => $currentHeaderValue];
[5025] Fix | Delete
}
[5026] Fix | Delete
$currentHeaderLabel = $matches[1];
[5027] Fix | Delete
$currentHeaderValue = $matches[2];
[5028] Fix | Delete
} elseif (preg_match('/^[ \t]+(.*)$/', $headerLine, $matches)) {
[5029] Fix | Delete
//This is a folded continuation of the current header, so unfold it
[5030] Fix | Delete
$currentHeaderValue .= ' ' . $matches[1];
[5031] Fix | Delete
}
[5032] Fix | Delete
++$headerLineIndex;
[5033] Fix | Delete
if ($headerLineIndex >= $headerLineCount) {
[5034] Fix | Delete
//This was the last line, so finish off this header
[5035] Fix | Delete
$parsedHeaders[] = ['label' => $currentHeaderLabel, 'value' => $currentHeaderValue];
[5036] Fix | Delete
}
[5037] Fix | Delete
}
[5038] Fix | Delete
$copiedHeaders = [];
[5039] Fix | Delete
$headersToSignKeys = [];
[5040] Fix | Delete
$headersToSign = [];
[5041] Fix | Delete
foreach ($parsedHeaders as $header) {
[5042] Fix | Delete
//Is this header one that must be included in the DKIM signature?
[5043] Fix | Delete
if (in_array(strtolower($header['label']), $autoSignHeaders, true)) {
[5044] Fix | Delete
$headersToSignKeys[] = $header['label'];
[5045] Fix | Delete
$headersToSign[] = $header['label'] . ': ' . $header['value'];
[5046] Fix | Delete
if ($this->DKIM_copyHeaderFields) {
[5047] Fix | Delete
$copiedHeaders[] = $header['label'] . ':' . //Note no space after this, as per RFC
[5048] Fix | Delete
str_replace('|', '=7C', $this->DKIM_QP($header['value']));
[5049] Fix | Delete
}
[5050] Fix | Delete
continue;
[5051] Fix | Delete
}
[5052] Fix | Delete
//Is this an extra custom header we've been asked to sign?
[5053] Fix | Delete
if (in_array($header['label'], $this->DKIM_extraHeaders, true)) {
[5054] Fix | Delete
//Find its value in custom headers
[5055] Fix | Delete
foreach ($this->CustomHeader as $customHeader) {
[5056] Fix | Delete
if ($customHeader[0] === $header['label']) {
[5057] Fix | Delete
$headersToSignKeys[] = $header['label'];
[5058] Fix | Delete
$headersToSign[] = $header['label'] . ': ' . $header['value'];
[5059] Fix | Delete
if ($this->DKIM_copyHeaderFields) {
[5060] Fix | Delete
$copiedHeaders[] = $header['label'] . ':' . //Note no space after this, as per RFC
[5061] Fix | Delete
str_replace('|', '=7C', $this->DKIM_QP($header['value']));
[5062] Fix | Delete
}
[5063] Fix | Delete
//Skip straight to the next header
[5064] Fix | Delete
continue 2;
[5065] Fix | Delete
}
[5066] Fix | Delete
}
[5067] Fix | Delete
}
[5068] Fix | Delete
}
[5069] Fix | Delete
$copiedHeaderFields = '';
[5070] Fix | Delete
if ($this->DKIM_copyHeaderFields && count($copiedHeaders) > 0) {
[5071] Fix | Delete
//Assemble a DKIM 'z' tag
[5072] Fix | Delete
$copiedHeaderFields = ' z=';
[5073] Fix | Delete
$first = true;
[5074] Fix | Delete
foreach ($copiedHeaders as $copiedHeader) {
[5075] Fix | Delete
if (!$first) {
[5076] Fix | Delete
$copiedHeaderFields .= static::$LE . ' |';
[5077] Fix | Delete
}
[5078] Fix | Delete
//Fold long values
[5079] Fix | Delete
if (strlen($copiedHeader) > self::STD_LINE_LENGTH - 3) {
[5080] Fix | Delete
$copiedHeaderFields .= substr(
[5081] Fix | Delete
chunk_split($copiedHeader, self::STD_LINE_LENGTH - 3, static::$LE . self::FWS),
[5082] Fix | Delete
0,
[5083] Fix | Delete
-strlen(static::$LE . self::FWS)
[5084] Fix | Delete
);
[5085] Fix | Delete
} else {
[5086] Fix | Delete
$copiedHeaderFields .= $copiedHeader;
[5087] Fix | Delete
}
[5088] Fix | Delete
$first = false;
[5089] Fix | Delete
}
[5090] Fix | Delete
$copiedHeaderFields .= ';' . static::$LE;
[5091] Fix | Delete
}
[5092] Fix | Delete
$headerKeys = ' h=' . implode(':', $headersToSignKeys) . ';' . static::$LE;
[5093] Fix | Delete
$headerValues = implode(static::$LE, $headersToSign);
[5094] Fix | Delete
$body = $this->DKIM_BodyC($body);
[5095] Fix | Delete
//Base64 of packed binary SHA-256 hash of body
[5096] Fix | Delete
$DKIMb64 = base64_encode(pack('H*', hash('sha256', $body)));
[5097] Fix | Delete
$ident = '';
[5098] Fix | Delete
if ('' !== $this->DKIM_identity) {
[5099] Fix | Delete
$ident = ' i=' . $this->DKIM_identity . ';' . static::$LE;
[5100] Fix | Delete
}
[5101] Fix | Delete
//The DKIM-Signature header is included in the signature *except for* the value of the `b` tag
[5102] Fix | Delete
//which is appended after calculating the signature
[5103] Fix | Delete
//https://tools.ietf.org/html/rfc6376#section-3.5
[5104] Fix | Delete
$dkimSignatureHeader = 'DKIM-Signature: v=1;' .
[5105] Fix | Delete
' d=' . $this->DKIM_domain . ';' .
[5106] Fix | Delete
' s=' . $this->DKIM_selector . ';' . static::$LE .
[5107] Fix | Delete
' a=' . $DKIMsignatureType . ';' .
[5108] Fix | Delete
' q=' . $DKIMquery . ';' .
[5109] Fix | Delete
' t=' . $DKIMtime . ';' .
[5110] Fix | Delete
' c=' . $DKIMcanonicalization . ';' . static::$LE .
[5111] Fix | Delete
$headerKeys .
[5112] Fix | Delete
$ident .
[5113] Fix | Delete
$copiedHeaderFields .
[5114] Fix | Delete
' bh=' . $DKIMb64 . ';' . static::$LE .
[5115] Fix | Delete
' b=';
[5116] Fix | Delete
//Canonicalize the set of headers
[5117] Fix | Delete
$canonicalizedHeaders = $this->DKIM_HeaderC(
[5118] Fix | Delete
$headerValues . static::$LE . $dkimSignatureHeader
[5119] Fix | Delete
);
[5120] Fix | Delete
$signature = $this->DKIM_Sign($canonicalizedHeaders);
[5121] Fix | Delete
$signature = trim(chunk_split($signature, self::STD_LINE_LENGTH - 3, static::$LE . self::FWS));
[5122] Fix | Delete
[5123] Fix | Delete
return static::normalizeBreaks($dkimSignatureHeader . $signature);
[5124] Fix | Delete
}
[5125] Fix | Delete
[5126] Fix | Delete
/**
[5127] Fix | Delete
* Detect if a string contains a line longer than the maximum line length
[5128] Fix | Delete
* allowed by RFC 2822 section 2.1.1.
[5129] Fix | Delete
*
[5130] Fix | Delete
* @param string $str
[5131] Fix | Delete
*
[5132] Fix | Delete
* @return bool
[5133] Fix | Delete
*/
[5134] Fix | Delete
public static function hasLineLongerThanMax($str)
[5135] Fix | Delete
{
[5136] Fix | Delete
return (bool) preg_match('/^(.{' . (self::MAX_LINE_LENGTH + strlen(static::$LE)) . ',})/m', $str);
[5137] Fix | Delete
}
[5138] Fix | Delete
[5139] Fix | Delete
/**
[5140] Fix | Delete
* If a string contains any "special" characters, double-quote the name,
[5141] Fix | Delete
* and escape any double quotes with a backslash.
[5142] Fix | Delete
*
[5143] Fix | Delete
* @param string $str
[5144] Fix | Delete
*
[5145] Fix | Delete
* @return string
[5146] Fix | Delete
*
[5147] Fix | Delete
* @see RFC822 3.4.1
[5148] Fix | Delete
*/
[5149] Fix | Delete
public static function quotedString($str)
[5150] Fix | Delete
{
[5151] Fix | Delete
if (preg_match('/[ ()<>@,;:"\/\[\]?=]/', $str)) {
[5152] Fix | Delete
//If the string contains any of these chars, it must be double-quoted
[5153] Fix | Delete
//and any double quotes must be escaped with a backslash
[5154] Fix | Delete
return '"' . str_replace('"', '\\"', $str) . '"';
[5155] Fix | Delete
}
[5156] Fix | Delete
[5157] Fix | Delete
//Return the string untouched, it doesn't need quoting
[5158] Fix | Delete
return $str;
[5159] Fix | Delete
}
[5160] Fix | Delete
[5161] Fix | Delete
/**
[5162] Fix | Delete
* Allows for public read access to 'to' property.
[5163] Fix | Delete
* Before the send() call, queued addresses (i.e. with IDN) are not yet included.
[5164] Fix | Delete
*
[5165] Fix | Delete
* @return array
[5166] Fix | Delete
*/
[5167] Fix | Delete
public function getToAddresses()
[5168] Fix | Delete
{
[5169] Fix | Delete
return $this->to;
[5170] Fix | Delete
}
[5171] Fix | Delete
[5172] Fix | Delete
/**
[5173] Fix | Delete
* Allows for public read access to 'cc' property.
[5174] Fix | Delete
* Before the send() call, queued addresses (i.e. with IDN) are not yet included.
[5175] Fix | Delete
*
[5176] Fix | Delete
* @return array
[5177] Fix | Delete
*/
[5178] Fix | Delete
public function getCcAddresses()
[5179] Fix | Delete
{
[5180] Fix | Delete
return $this->cc;
[5181] Fix | Delete
}
[5182] Fix | Delete
[5183] Fix | Delete
/**
[5184] Fix | Delete
* Allows for public read access to 'bcc' property.
[5185] Fix | Delete
* Before the send() call, queued addresses (i.e. with IDN) are not yet included.
[5186] Fix | Delete
*
[5187] Fix | Delete
* @return array
[5188] Fix | Delete
*/
[5189] Fix | Delete
public function getBccAddresses()
[5190] Fix | Delete
{
[5191] Fix | Delete
return $this->bcc;
[5192] Fix | Delete
}
[5193] Fix | Delete
[5194] Fix | Delete
/**
[5195] Fix | Delete
* Allows for public read access to 'ReplyTo' property.
[5196] Fix | Delete
* Before the send() call, queued addresses (i.e. with IDN) are not yet included.
[5197] Fix | Delete
*
[5198] Fix | Delete
* @return array
[5199] Fix | Delete
*/
[5200] Fix | Delete
public function getReplyToAddresses()
[5201] Fix | Delete
{
[5202] Fix | Delete
return $this->ReplyTo;
[5203] Fix | Delete
}
[5204] Fix | Delete
[5205] Fix | Delete
/**
[5206] Fix | Delete
* Allows for public read access to 'all_recipients' property.
[5207] Fix | Delete
* Before the send() call, queued addresses (i.e. with IDN) are not yet included.
[5208] Fix | Delete
*
[5209] Fix | Delete
* @return array
[5210] Fix | Delete
*/
[5211] Fix | Delete
public function getAllRecipientAddresses()
[5212] Fix | Delete
{
[5213] Fix | Delete
return $this->all_recipients;
[5214] Fix | Delete
}
[5215] Fix | Delete
[5216] Fix | Delete
/**
[5217] Fix | Delete
* Perform a callback.
[5218] Fix | Delete
*
[5219] Fix | Delete
* @param bool $isSent
[5220] Fix | Delete
* @param array $to
[5221] Fix | Delete
* @param array $cc
[5222] Fix | Delete
* @param array $bcc
[5223] Fix | Delete
* @param string $subject
[5224] Fix | Delete
* @param string $body
[5225] Fix | Delete
* @param string $from
[5226] Fix | Delete
* @param array $extra
[5227] Fix | Delete
*/
[5228] Fix | Delete
protected function doCallback($isSent, $to, $cc, $bcc, $subject, $body, $from, $extra)
[5229] Fix | Delete
{
[5230] Fix | Delete
if (!empty($this->action_function) && is_callable($this->action_function)) {
[5231] Fix | Delete
call_user_func($this->action_function, $isSent, $to, $cc, $bcc, $subject, $body, $from, $extra);
[5232] Fix | Delete
}
[5233] Fix | Delete
}
[5234] Fix | Delete
[5235] Fix | Delete
/**
[5236] Fix | Delete
* Get the OAuthTokenProvider instance.
[5237] Fix | Delete
*
[5238] Fix | Delete
* @return OAuthTokenProvider
[5239] Fix | Delete
*/
[5240] Fix | Delete
public function getOAuth()
[5241] Fix | Delete
{
[5242] Fix | Delete
return $this->oauth;
[5243] Fix | Delete
}
[5244] Fix | Delete
[5245] Fix | Delete
/**
[5246] Fix | Delete
* Set an OAuthTokenProvider instance.
[5247] Fix | Delete
*/
[5248] Fix | Delete
public function setOAuth(OAuthTokenProvider $oauth)
[5249] Fix | Delete
{
[5250] Fix | Delete
$this->oauth = $oauth;
[5251] Fix | Delete
}
[5252] Fix | Delete
}
[5253] Fix | Delete
[5254] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function