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
break;
[3500] Fix | Delete
default:
[3501] Fix | Delete
$this->setError($this->lang('encoding') . $encoding);
[3502] Fix | Delete
if ($this->exceptions) {
[3503] Fix | Delete
throw new Exception($this->lang('encoding') . $encoding);
[3504] Fix | Delete
}
[3505] Fix | Delete
break;
[3506] Fix | Delete
}
[3507] Fix | Delete
[3508] Fix | Delete
return $encoded;
[3509] Fix | Delete
}
[3510] Fix | Delete
[3511] Fix | Delete
/**
[3512] Fix | Delete
* Encode a header value (not including its label) optimally.
[3513] Fix | Delete
* Picks shortest of Q, B, or none. Result includes folding if needed.
[3514] Fix | Delete
* See RFC822 definitions for phrase, comment and text positions.
[3515] Fix | Delete
*
[3516] Fix | Delete
* @param string $str The header value to encode
[3517] Fix | Delete
* @param string $position What context the string will be used in
[3518] Fix | Delete
*
[3519] Fix | Delete
* @return string
[3520] Fix | Delete
*/
[3521] Fix | Delete
public function encodeHeader($str, $position = 'text')
[3522] Fix | Delete
{
[3523] Fix | Delete
$matchcount = 0;
[3524] Fix | Delete
switch (strtolower($position)) {
[3525] Fix | Delete
case 'phrase':
[3526] Fix | Delete
if (!preg_match('/[\200-\377]/', $str)) {
[3527] Fix | Delete
//Can't use addslashes as we don't know the value of magic_quotes_sybase
[3528] Fix | Delete
$encoded = addcslashes($str, "\0..\37\177\\\"");
[3529] Fix | Delete
if (($str === $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) {
[3530] Fix | Delete
return $encoded;
[3531] Fix | Delete
}
[3532] Fix | Delete
[3533] Fix | Delete
return "\"$encoded\"";
[3534] Fix | Delete
}
[3535] Fix | Delete
$matchcount = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches);
[3536] Fix | Delete
break;
[3537] Fix | Delete
/* @noinspection PhpMissingBreakStatementInspection */
[3538] Fix | Delete
case 'comment':
[3539] Fix | Delete
$matchcount = preg_match_all('/[()"]/', $str, $matches);
[3540] Fix | Delete
//fallthrough
[3541] Fix | Delete
case 'text':
[3542] Fix | Delete
default:
[3543] Fix | Delete
$matchcount += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches);
[3544] Fix | Delete
break;
[3545] Fix | Delete
}
[3546] Fix | Delete
[3547] Fix | Delete
if ($this->has8bitChars($str)) {
[3548] Fix | Delete
$charset = $this->CharSet;
[3549] Fix | Delete
} else {
[3550] Fix | Delete
$charset = static::CHARSET_ASCII;
[3551] Fix | Delete
}
[3552] Fix | Delete
[3553] Fix | Delete
//Q/B encoding adds 8 chars and the charset ("` =?<charset>?[QB]?<content>?=`").
[3554] Fix | Delete
$overhead = 8 + strlen($charset);
[3555] Fix | Delete
[3556] Fix | Delete
if ('mail' === $this->Mailer) {
[3557] Fix | Delete
$maxlen = static::MAIL_MAX_LINE_LENGTH - $overhead;
[3558] Fix | Delete
} else {
[3559] Fix | Delete
$maxlen = static::MAX_LINE_LENGTH - $overhead;
[3560] Fix | Delete
}
[3561] Fix | Delete
[3562] Fix | Delete
//Select the encoding that produces the shortest output and/or prevents corruption.
[3563] Fix | Delete
if ($matchcount > strlen($str) / 3) {
[3564] Fix | Delete
//More than 1/3 of the content needs encoding, use B-encode.
[3565] Fix | Delete
$encoding = 'B';
[3566] Fix | Delete
} elseif ($matchcount > 0) {
[3567] Fix | Delete
//Less than 1/3 of the content needs encoding, use Q-encode.
[3568] Fix | Delete
$encoding = 'Q';
[3569] Fix | Delete
} elseif (strlen($str) > $maxlen) {
[3570] Fix | Delete
//No encoding needed, but value exceeds max line length, use Q-encode to prevent corruption.
[3571] Fix | Delete
$encoding = 'Q';
[3572] Fix | Delete
} else {
[3573] Fix | Delete
//No reformatting needed
[3574] Fix | Delete
$encoding = false;
[3575] Fix | Delete
}
[3576] Fix | Delete
[3577] Fix | Delete
switch ($encoding) {
[3578] Fix | Delete
case 'B':
[3579] Fix | Delete
if ($this->hasMultiBytes($str)) {
[3580] Fix | Delete
//Use a custom function which correctly encodes and wraps long
[3581] Fix | Delete
//multibyte strings without breaking lines within a character
[3582] Fix | Delete
$encoded = $this->base64EncodeWrapMB($str, "\n");
[3583] Fix | Delete
} else {
[3584] Fix | Delete
$encoded = base64_encode($str);
[3585] Fix | Delete
$maxlen -= $maxlen % 4;
[3586] Fix | Delete
$encoded = trim(chunk_split($encoded, $maxlen, "\n"));
[3587] Fix | Delete
}
[3588] Fix | Delete
$encoded = preg_replace('/^(.*)$/m', ' =?' . $charset . "?$encoding?\\1?=", $encoded);
[3589] Fix | Delete
break;
[3590] Fix | Delete
case 'Q':
[3591] Fix | Delete
$encoded = $this->encodeQ($str, $position);
[3592] Fix | Delete
$encoded = $this->wrapText($encoded, $maxlen, true);
[3593] Fix | Delete
$encoded = str_replace('=' . static::$LE, "\n", trim($encoded));
[3594] Fix | Delete
$encoded = preg_replace('/^(.*)$/m', ' =?' . $charset . "?$encoding?\\1?=", $encoded);
[3595] Fix | Delete
break;
[3596] Fix | Delete
default:
[3597] Fix | Delete
return $str;
[3598] Fix | Delete
}
[3599] Fix | Delete
[3600] Fix | Delete
return trim(static::normalizeBreaks($encoded));
[3601] Fix | Delete
}
[3602] Fix | Delete
[3603] Fix | Delete
/**
[3604] Fix | Delete
* Check if a string contains multi-byte characters.
[3605] Fix | Delete
*
[3606] Fix | Delete
* @param string $str multi-byte text to wrap encode
[3607] Fix | Delete
*
[3608] Fix | Delete
* @return bool
[3609] Fix | Delete
*/
[3610] Fix | Delete
public function hasMultiBytes($str)
[3611] Fix | Delete
{
[3612] Fix | Delete
if (function_exists('mb_strlen')) {
[3613] Fix | Delete
return strlen($str) > mb_strlen($str, $this->CharSet);
[3614] Fix | Delete
}
[3615] Fix | Delete
[3616] Fix | Delete
//Assume no multibytes (we can't handle without mbstring functions anyway)
[3617] Fix | Delete
return false;
[3618] Fix | Delete
}
[3619] Fix | Delete
[3620] Fix | Delete
/**
[3621] Fix | Delete
* Does a string contain any 8-bit chars (in any charset)?
[3622] Fix | Delete
*
[3623] Fix | Delete
* @param string $text
[3624] Fix | Delete
*
[3625] Fix | Delete
* @return bool
[3626] Fix | Delete
*/
[3627] Fix | Delete
public function has8bitChars($text)
[3628] Fix | Delete
{
[3629] Fix | Delete
return (bool) preg_match('/[\x80-\xFF]/', $text);
[3630] Fix | Delete
}
[3631] Fix | Delete
[3632] Fix | Delete
/**
[3633] Fix | Delete
* Encode and wrap long multibyte strings for mail headers
[3634] Fix | Delete
* without breaking lines within a character.
[3635] Fix | Delete
* Adapted from a function by paravoid.
[3636] Fix | Delete
*
[3637] Fix | Delete
* @see http://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283
[3638] Fix | Delete
*
[3639] Fix | Delete
* @param string $str multi-byte text to wrap encode
[3640] Fix | Delete
* @param string $linebreak string to use as linefeed/end-of-line
[3641] Fix | Delete
*
[3642] Fix | Delete
* @return string
[3643] Fix | Delete
*/
[3644] Fix | Delete
public function base64EncodeWrapMB($str, $linebreak = null)
[3645] Fix | Delete
{
[3646] Fix | Delete
$start = '=?' . $this->CharSet . '?B?';
[3647] Fix | Delete
$end = '?=';
[3648] Fix | Delete
$encoded = '';
[3649] Fix | Delete
if (null === $linebreak) {
[3650] Fix | Delete
$linebreak = static::$LE;
[3651] Fix | Delete
}
[3652] Fix | Delete
[3653] Fix | Delete
$mb_length = mb_strlen($str, $this->CharSet);
[3654] Fix | Delete
//Each line must have length <= 75, including $start and $end
[3655] Fix | Delete
$length = 75 - strlen($start) - strlen($end);
[3656] Fix | Delete
//Average multi-byte ratio
[3657] Fix | Delete
$ratio = $mb_length / strlen($str);
[3658] Fix | Delete
//Base64 has a 4:3 ratio
[3659] Fix | Delete
$avgLength = floor($length * $ratio * .75);
[3660] Fix | Delete
[3661] Fix | Delete
$offset = 0;
[3662] Fix | Delete
for ($i = 0; $i < $mb_length; $i += $offset) {
[3663] Fix | Delete
$lookBack = 0;
[3664] Fix | Delete
do {
[3665] Fix | Delete
$offset = $avgLength - $lookBack;
[3666] Fix | Delete
$chunk = mb_substr($str, $i, $offset, $this->CharSet);
[3667] Fix | Delete
$chunk = base64_encode($chunk);
[3668] Fix | Delete
++$lookBack;
[3669] Fix | Delete
} while (strlen($chunk) > $length);
[3670] Fix | Delete
$encoded .= $chunk . $linebreak;
[3671] Fix | Delete
}
[3672] Fix | Delete
[3673] Fix | Delete
//Chomp the last linefeed
[3674] Fix | Delete
return substr($encoded, 0, -strlen($linebreak));
[3675] Fix | Delete
}
[3676] Fix | Delete
[3677] Fix | Delete
/**
[3678] Fix | Delete
* Encode a string in quoted-printable format.
[3679] Fix | Delete
* According to RFC2045 section 6.7.
[3680] Fix | Delete
*
[3681] Fix | Delete
* @param string $string The text to encode
[3682] Fix | Delete
*
[3683] Fix | Delete
* @return string
[3684] Fix | Delete
*/
[3685] Fix | Delete
public function encodeQP($string)
[3686] Fix | Delete
{
[3687] Fix | Delete
return static::normalizeBreaks(quoted_printable_encode($string));
[3688] Fix | Delete
}
[3689] Fix | Delete
[3690] Fix | Delete
/**
[3691] Fix | Delete
* Encode a string using Q encoding.
[3692] Fix | Delete
*
[3693] Fix | Delete
* @see http://tools.ietf.org/html/rfc2047#section-4.2
[3694] Fix | Delete
*
[3695] Fix | Delete
* @param string $str the text to encode
[3696] Fix | Delete
* @param string $position Where the text is going to be used, see the RFC for what that means
[3697] Fix | Delete
*
[3698] Fix | Delete
* @return string
[3699] Fix | Delete
*/
[3700] Fix | Delete
public function encodeQ($str, $position = 'text')
[3701] Fix | Delete
{
[3702] Fix | Delete
//There should not be any EOL in the string
[3703] Fix | Delete
$pattern = '';
[3704] Fix | Delete
$encoded = str_replace(["\r", "\n"], '', $str);
[3705] Fix | Delete
switch (strtolower($position)) {
[3706] Fix | Delete
case 'phrase':
[3707] Fix | Delete
//RFC 2047 section 5.3
[3708] Fix | Delete
$pattern = '^A-Za-z0-9!*+\/ -';
[3709] Fix | Delete
break;
[3710] Fix | Delete
/*
[3711] Fix | Delete
* RFC 2047 section 5.2.
[3712] Fix | Delete
* Build $pattern without including delimiters and []
[3713] Fix | Delete
*/
[3714] Fix | Delete
/* @noinspection PhpMissingBreakStatementInspection */
[3715] Fix | Delete
case 'comment':
[3716] Fix | Delete
$pattern = '\(\)"';
[3717] Fix | Delete
/* Intentional fall through */
[3718] Fix | Delete
case 'text':
[3719] Fix | Delete
default:
[3720] Fix | Delete
//RFC 2047 section 5.1
[3721] Fix | Delete
//Replace every high ascii, control, =, ? and _ characters
[3722] Fix | Delete
$pattern = '\000-\011\013\014\016-\037\075\077\137\177-\377' . $pattern;
[3723] Fix | Delete
break;
[3724] Fix | Delete
}
[3725] Fix | Delete
$matches = [];
[3726] Fix | Delete
if (preg_match_all("/[{$pattern}]/", $encoded, $matches)) {
[3727] Fix | Delete
//If the string contains an '=', make sure it's the first thing we replace
[3728] Fix | Delete
//so as to avoid double-encoding
[3729] Fix | Delete
$eqkey = array_search('=', $matches[0], true);
[3730] Fix | Delete
if (false !== $eqkey) {
[3731] Fix | Delete
unset($matches[0][$eqkey]);
[3732] Fix | Delete
array_unshift($matches[0], '=');
[3733] Fix | Delete
}
[3734] Fix | Delete
foreach (array_unique($matches[0]) as $char) {
[3735] Fix | Delete
$encoded = str_replace($char, '=' . sprintf('%02X', ord($char)), $encoded);
[3736] Fix | Delete
}
[3737] Fix | Delete
}
[3738] Fix | Delete
//Replace spaces with _ (more readable than =20)
[3739] Fix | Delete
//RFC 2047 section 4.2(2)
[3740] Fix | Delete
return str_replace(' ', '_', $encoded);
[3741] Fix | Delete
}
[3742] Fix | Delete
[3743] Fix | Delete
/**
[3744] Fix | Delete
* Add a string or binary attachment (non-filesystem).
[3745] Fix | Delete
* This method can be used to attach ascii or binary data,
[3746] Fix | Delete
* such as a BLOB record from a database.
[3747] Fix | Delete
*
[3748] Fix | Delete
* @param string $string String attachment data
[3749] Fix | Delete
* @param string $filename Name of the attachment
[3750] Fix | Delete
* @param string $encoding File encoding (see $Encoding)
[3751] Fix | Delete
* @param string $type File extension (MIME) type
[3752] Fix | Delete
* @param string $disposition Disposition to use
[3753] Fix | Delete
*
[3754] Fix | Delete
* @throws Exception
[3755] Fix | Delete
*
[3756] Fix | Delete
* @return bool True on successfully adding an attachment
[3757] Fix | Delete
*/
[3758] Fix | Delete
public function addStringAttachment(
[3759] Fix | Delete
$string,
[3760] Fix | Delete
$filename,
[3761] Fix | Delete
$encoding = self::ENCODING_BASE64,
[3762] Fix | Delete
$type = '',
[3763] Fix | Delete
$disposition = 'attachment'
[3764] Fix | Delete
) {
[3765] Fix | Delete
try {
[3766] Fix | Delete
//If a MIME type is not specified, try to work it out from the file name
[3767] Fix | Delete
if ('' === $type) {
[3768] Fix | Delete
$type = static::filenameToType($filename);
[3769] Fix | Delete
}
[3770] Fix | Delete
[3771] Fix | Delete
if (!$this->validateEncoding($encoding)) {
[3772] Fix | Delete
throw new Exception($this->lang('encoding') . $encoding);
[3773] Fix | Delete
}
[3774] Fix | Delete
[3775] Fix | Delete
//Append to $attachment array
[3776] Fix | Delete
$this->attachment[] = [
[3777] Fix | Delete
0 => $string,
[3778] Fix | Delete
1 => $filename,
[3779] Fix | Delete
2 => static::mb_pathinfo($filename, PATHINFO_BASENAME),
[3780] Fix | Delete
3 => $encoding,
[3781] Fix | Delete
4 => $type,
[3782] Fix | Delete
5 => true, //isStringAttachment
[3783] Fix | Delete
6 => $disposition,
[3784] Fix | Delete
7 => 0,
[3785] Fix | Delete
];
[3786] Fix | Delete
} catch (Exception $exc) {
[3787] Fix | Delete
$this->setError($exc->getMessage());
[3788] Fix | Delete
$this->edebug($exc->getMessage());
[3789] Fix | Delete
if ($this->exceptions) {
[3790] Fix | Delete
throw $exc;
[3791] Fix | Delete
}
[3792] Fix | Delete
[3793] Fix | Delete
return false;
[3794] Fix | Delete
}
[3795] Fix | Delete
[3796] Fix | Delete
return true;
[3797] Fix | Delete
}
[3798] Fix | Delete
[3799] Fix | Delete
/**
[3800] Fix | Delete
* Add an embedded (inline) attachment from a file.
[3801] Fix | Delete
* This can include images, sounds, and just about any other document type.
[3802] Fix | Delete
* These differ from 'regular' attachments in that they are intended to be
[3803] Fix | Delete
* displayed inline with the message, not just attached for download.
[3804] Fix | Delete
* This is used in HTML messages that embed the images
[3805] Fix | Delete
* the HTML refers to using the `$cid` value in `img` tags, for example `<img src="cid:mylogo">`.
[3806] Fix | Delete
* Never use a user-supplied path to a file!
[3807] Fix | Delete
*
[3808] Fix | Delete
* @param string $path Path to the attachment
[3809] Fix | Delete
* @param string $cid Content ID of the attachment; Use this to reference
[3810] Fix | Delete
* the content when using an embedded image in HTML
[3811] Fix | Delete
* @param string $name Overrides the attachment filename
[3812] Fix | Delete
* @param string $encoding File encoding (see $Encoding) defaults to `base64`
[3813] Fix | Delete
* @param string $type File MIME type (by default mapped from the `$path` filename's extension)
[3814] Fix | Delete
* @param string $disposition Disposition to use: `inline` (default) or `attachment`
[3815] Fix | Delete
* (unlikely you want this – {@see `addAttachment()`} instead)
[3816] Fix | Delete
*
[3817] Fix | Delete
* @return bool True on successfully adding an attachment
[3818] Fix | Delete
* @throws Exception
[3819] Fix | Delete
*
[3820] Fix | Delete
*/
[3821] Fix | Delete
public function addEmbeddedImage(
[3822] Fix | Delete
$path,
[3823] Fix | Delete
$cid,
[3824] Fix | Delete
$name = '',
[3825] Fix | Delete
$encoding = self::ENCODING_BASE64,
[3826] Fix | Delete
$type = '',
[3827] Fix | Delete
$disposition = 'inline'
[3828] Fix | Delete
) {
[3829] Fix | Delete
try {
[3830] Fix | Delete
if (!static::fileIsAccessible($path)) {
[3831] Fix | Delete
throw new Exception($this->lang('file_access') . $path, self::STOP_CONTINUE);
[3832] Fix | Delete
}
[3833] Fix | Delete
[3834] Fix | Delete
//If a MIME type is not specified, try to work it out from the file name
[3835] Fix | Delete
if ('' === $type) {
[3836] Fix | Delete
$type = static::filenameToType($path);
[3837] Fix | Delete
}
[3838] Fix | Delete
[3839] Fix | Delete
if (!$this->validateEncoding($encoding)) {
[3840] Fix | Delete
throw new Exception($this->lang('encoding') . $encoding);
[3841] Fix | Delete
}
[3842] Fix | Delete
[3843] Fix | Delete
$filename = (string) static::mb_pathinfo($path, PATHINFO_BASENAME);
[3844] Fix | Delete
if ('' === $name) {
[3845] Fix | Delete
$name = $filename;
[3846] Fix | Delete
}
[3847] Fix | Delete
[3848] Fix | Delete
//Append to $attachment array
[3849] Fix | Delete
$this->attachment[] = [
[3850] Fix | Delete
0 => $path,
[3851] Fix | Delete
1 => $filename,
[3852] Fix | Delete
2 => $name,
[3853] Fix | Delete
3 => $encoding,
[3854] Fix | Delete
4 => $type,
[3855] Fix | Delete
5 => false, //isStringAttachment
[3856] Fix | Delete
6 => $disposition,
[3857] Fix | Delete
7 => $cid,
[3858] Fix | Delete
];
[3859] Fix | Delete
} catch (Exception $exc) {
[3860] Fix | Delete
$this->setError($exc->getMessage());
[3861] Fix | Delete
$this->edebug($exc->getMessage());
[3862] Fix | Delete
if ($this->exceptions) {
[3863] Fix | Delete
throw $exc;
[3864] Fix | Delete
}
[3865] Fix | Delete
[3866] Fix | Delete
return false;
[3867] Fix | Delete
}
[3868] Fix | Delete
[3869] Fix | Delete
return true;
[3870] Fix | Delete
}
[3871] Fix | Delete
[3872] Fix | Delete
/**
[3873] Fix | Delete
* Add an embedded stringified attachment.
[3874] Fix | Delete
* This can include images, sounds, and just about any other document type.
[3875] Fix | Delete
* If your filename doesn't contain an extension, be sure to set the $type to an appropriate MIME type.
[3876] Fix | Delete
*
[3877] Fix | Delete
* @param string $string The attachment binary data
[3878] Fix | Delete
* @param string $cid Content ID of the attachment; Use this to reference
[3879] Fix | Delete
* the content when using an embedded image in HTML
[3880] Fix | Delete
* @param string $name A filename for the attachment. If this contains an extension,
[3881] Fix | Delete
* PHPMailer will attempt to set a MIME type for the attachment.
[3882] Fix | Delete
* For example 'file.jpg' would get an 'image/jpeg' MIME type.
[3883] Fix | Delete
* @param string $encoding File encoding (see $Encoding), defaults to 'base64'
[3884] Fix | Delete
* @param string $type MIME type - will be used in preference to any automatically derived type
[3885] Fix | Delete
* @param string $disposition Disposition to use
[3886] Fix | Delete
*
[3887] Fix | Delete
* @throws Exception
[3888] Fix | Delete
*
[3889] Fix | Delete
* @return bool True on successfully adding an attachment
[3890] Fix | Delete
*/
[3891] Fix | Delete
public function addStringEmbeddedImage(
[3892] Fix | Delete
$string,
[3893] Fix | Delete
$cid,
[3894] Fix | Delete
$name = '',
[3895] Fix | Delete
$encoding = self::ENCODING_BASE64,
[3896] Fix | Delete
$type = '',
[3897] Fix | Delete
$disposition = 'inline'
[3898] Fix | Delete
) {
[3899] Fix | Delete
try {
[3900] Fix | Delete
//If a MIME type is not specified, try to work it out from the name
[3901] Fix | Delete
if ('' === $type && !empty($name)) {
[3902] Fix | Delete
$type = static::filenameToType($name);
[3903] Fix | Delete
}
[3904] Fix | Delete
[3905] Fix | Delete
if (!$this->validateEncoding($encoding)) {
[3906] Fix | Delete
throw new Exception($this->lang('encoding') . $encoding);
[3907] Fix | Delete
}
[3908] Fix | Delete
[3909] Fix | Delete
//Append to $attachment array
[3910] Fix | Delete
$this->attachment[] = [
[3911] Fix | Delete
0 => $string,
[3912] Fix | Delete
1 => $name,
[3913] Fix | Delete
2 => $name,
[3914] Fix | Delete
3 => $encoding,
[3915] Fix | Delete
4 => $type,
[3916] Fix | Delete
5 => true, //isStringAttachment
[3917] Fix | Delete
6 => $disposition,
[3918] Fix | Delete
7 => $cid,
[3919] Fix | Delete
];
[3920] Fix | Delete
} catch (Exception $exc) {
[3921] Fix | Delete
$this->setError($exc->getMessage());
[3922] Fix | Delete
$this->edebug($exc->getMessage());
[3923] Fix | Delete
if ($this->exceptions) {
[3924] Fix | Delete
throw $exc;
[3925] Fix | Delete
}
[3926] Fix | Delete
[3927] Fix | Delete
return false;
[3928] Fix | Delete
}
[3929] Fix | Delete
[3930] Fix | Delete
return true;
[3931] Fix | Delete
}
[3932] Fix | Delete
[3933] Fix | Delete
/**
[3934] Fix | Delete
* Validate encodings.
[3935] Fix | Delete
*
[3936] Fix | Delete
* @param string $encoding
[3937] Fix | Delete
*
[3938] Fix | Delete
* @return bool
[3939] Fix | Delete
*/
[3940] Fix | Delete
protected function validateEncoding($encoding)
[3941] Fix | Delete
{
[3942] Fix | Delete
return in_array(
[3943] Fix | Delete
$encoding,
[3944] Fix | Delete
[
[3945] Fix | Delete
self::ENCODING_7BIT,
[3946] Fix | Delete
self::ENCODING_QUOTED_PRINTABLE,
[3947] Fix | Delete
self::ENCODING_BASE64,
[3948] Fix | Delete
self::ENCODING_8BIT,
[3949] Fix | Delete
self::ENCODING_BINARY,
[3950] Fix | Delete
],
[3951] Fix | Delete
true
[3952] Fix | Delete
);
[3953] Fix | Delete
}
[3954] Fix | Delete
[3955] Fix | Delete
/**
[3956] Fix | Delete
* Check if an embedded attachment is present with this cid.
[3957] Fix | Delete
*
[3958] Fix | Delete
* @param string $cid
[3959] Fix | Delete
*
[3960] Fix | Delete
* @return bool
[3961] Fix | Delete
*/
[3962] Fix | Delete
protected function cidExists($cid)
[3963] Fix | Delete
{
[3964] Fix | Delete
foreach ($this->attachment as $attachment) {
[3965] Fix | Delete
if ('inline' === $attachment[6] && $cid === $attachment[7]) {
[3966] Fix | Delete
return true;
[3967] Fix | Delete
}
[3968] Fix | Delete
}
[3969] Fix | Delete
[3970] Fix | Delete
return false;
[3971] Fix | Delete
}
[3972] Fix | Delete
[3973] Fix | Delete
/**
[3974] Fix | Delete
* Check if an inline attachment is present.
[3975] Fix | Delete
*
[3976] Fix | Delete
* @return bool
[3977] Fix | Delete
*/
[3978] Fix | Delete
public function inlineImageExists()
[3979] Fix | Delete
{
[3980] Fix | Delete
foreach ($this->attachment as $attachment) {
[3981] Fix | Delete
if ('inline' === $attachment[6]) {
[3982] Fix | Delete
return true;
[3983] Fix | Delete
}
[3984] Fix | Delete
}
[3985] Fix | Delete
[3986] Fix | Delete
return false;
[3987] Fix | Delete
}
[3988] Fix | Delete
[3989] Fix | Delete
/**
[3990] Fix | Delete
* Check if an attachment (non-inline) is present.
[3991] Fix | Delete
*
[3992] Fix | Delete
* @return bool
[3993] Fix | Delete
*/
[3994] Fix | Delete
public function attachmentExists()
[3995] Fix | Delete
{
[3996] Fix | Delete
foreach ($this->attachment as $attachment) {
[3997] Fix | Delete
if ('attachment' === $attachment[6]) {
[3998] Fix | Delete
return true;
[3999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function