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
/**
[2000] Fix | Delete
* Provide an instance to use for SMTP operations.
[2001] Fix | Delete
*
[2002] Fix | Delete
* @return SMTP
[2003] Fix | Delete
*/
[2004] Fix | Delete
public function setSMTPInstance(SMTP $smtp)
[2005] Fix | Delete
{
[2006] Fix | Delete
$this->smtp = $smtp;
[2007] Fix | Delete
[2008] Fix | Delete
return $this->smtp;
[2009] Fix | Delete
}
[2010] Fix | Delete
[2011] Fix | Delete
/**
[2012] Fix | Delete
* Provide SMTP XCLIENT attributes
[2013] Fix | Delete
*
[2014] Fix | Delete
* @param string $name Attribute name
[2015] Fix | Delete
* @param ?string $value Attribute value
[2016] Fix | Delete
*
[2017] Fix | Delete
* @return bool
[2018] Fix | Delete
*/
[2019] Fix | Delete
public function setSMTPXclientAttribute($name, $value)
[2020] Fix | Delete
{
[2021] Fix | Delete
if (!in_array($name, SMTP::$xclient_allowed_attributes)) {
[2022] Fix | Delete
return false;
[2023] Fix | Delete
}
[2024] Fix | Delete
if (isset($this->SMTPXClient[$name]) && $value === null) {
[2025] Fix | Delete
unset($this->SMTPXClient[$name]);
[2026] Fix | Delete
} elseif ($value !== null) {
[2027] Fix | Delete
$this->SMTPXClient[$name] = $value;
[2028] Fix | Delete
}
[2029] Fix | Delete
[2030] Fix | Delete
return true;
[2031] Fix | Delete
}
[2032] Fix | Delete
[2033] Fix | Delete
/**
[2034] Fix | Delete
* Get SMTP XCLIENT attributes
[2035] Fix | Delete
*
[2036] Fix | Delete
* @return array
[2037] Fix | Delete
*/
[2038] Fix | Delete
public function getSMTPXclientAttributes()
[2039] Fix | Delete
{
[2040] Fix | Delete
return $this->SMTPXClient;
[2041] Fix | Delete
}
[2042] Fix | Delete
[2043] Fix | Delete
/**
[2044] Fix | Delete
* Send mail via SMTP.
[2045] Fix | Delete
* Returns false if there is a bad MAIL FROM, RCPT, or DATA input.
[2046] Fix | Delete
*
[2047] Fix | Delete
* @see PHPMailer::setSMTPInstance() to use a different class.
[2048] Fix | Delete
*
[2049] Fix | Delete
* @uses \PHPMailer\PHPMailer\SMTP
[2050] Fix | Delete
*
[2051] Fix | Delete
* @param string $header The message headers
[2052] Fix | Delete
* @param string $body The message body
[2053] Fix | Delete
*
[2054] Fix | Delete
* @throws Exception
[2055] Fix | Delete
*
[2056] Fix | Delete
* @return bool
[2057] Fix | Delete
*/
[2058] Fix | Delete
protected function smtpSend($header, $body)
[2059] Fix | Delete
{
[2060] Fix | Delete
$header = static::stripTrailingWSP($header) . static::$LE . static::$LE;
[2061] Fix | Delete
$bad_rcpt = [];
[2062] Fix | Delete
if (!$this->smtpConnect($this->SMTPOptions)) {
[2063] Fix | Delete
throw new Exception($this->lang('smtp_connect_failed'), self::STOP_CRITICAL);
[2064] Fix | Delete
}
[2065] Fix | Delete
//Sender already validated in preSend()
[2066] Fix | Delete
if ('' === $this->Sender) {
[2067] Fix | Delete
$smtp_from = $this->From;
[2068] Fix | Delete
} else {
[2069] Fix | Delete
$smtp_from = $this->Sender;
[2070] Fix | Delete
}
[2071] Fix | Delete
if (count($this->SMTPXClient)) {
[2072] Fix | Delete
$this->smtp->xclient($this->SMTPXClient);
[2073] Fix | Delete
}
[2074] Fix | Delete
if (!$this->smtp->mail($smtp_from)) {
[2075] Fix | Delete
$this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError()));
[2076] Fix | Delete
throw new Exception($this->ErrorInfo, self::STOP_CRITICAL);
[2077] Fix | Delete
}
[2078] Fix | Delete
[2079] Fix | Delete
$callbacks = [];
[2080] Fix | Delete
//Attempt to send to all recipients
[2081] Fix | Delete
foreach ([$this->to, $this->cc, $this->bcc] as $togroup) {
[2082] Fix | Delete
foreach ($togroup as $to) {
[2083] Fix | Delete
if (!$this->smtp->recipient($to[0], $this->dsn)) {
[2084] Fix | Delete
$error = $this->smtp->getError();
[2085] Fix | Delete
$bad_rcpt[] = ['to' => $to[0], 'error' => $error['detail']];
[2086] Fix | Delete
$isSent = false;
[2087] Fix | Delete
} else {
[2088] Fix | Delete
$isSent = true;
[2089] Fix | Delete
}
[2090] Fix | Delete
[2091] Fix | Delete
$callbacks[] = ['issent' => $isSent, 'to' => $to[0], 'name' => $to[1]];
[2092] Fix | Delete
}
[2093] Fix | Delete
}
[2094] Fix | Delete
[2095] Fix | Delete
//Only send the DATA command if we have viable recipients
[2096] Fix | Delete
if ((count($this->all_recipients) > count($bad_rcpt)) && !$this->smtp->data($header . $body)) {
[2097] Fix | Delete
throw new Exception($this->lang('data_not_accepted'), self::STOP_CRITICAL);
[2098] Fix | Delete
}
[2099] Fix | Delete
[2100] Fix | Delete
$smtp_transaction_id = $this->smtp->getLastTransactionID();
[2101] Fix | Delete
[2102] Fix | Delete
if ($this->SMTPKeepAlive) {
[2103] Fix | Delete
$this->smtp->reset();
[2104] Fix | Delete
} else {
[2105] Fix | Delete
$this->smtp->quit();
[2106] Fix | Delete
$this->smtp->close();
[2107] Fix | Delete
}
[2108] Fix | Delete
[2109] Fix | Delete
foreach ($callbacks as $cb) {
[2110] Fix | Delete
$this->doCallback(
[2111] Fix | Delete
$cb['issent'],
[2112] Fix | Delete
[[$cb['to'], $cb['name']]],
[2113] Fix | Delete
[],
[2114] Fix | Delete
[],
[2115] Fix | Delete
$this->Subject,
[2116] Fix | Delete
$body,
[2117] Fix | Delete
$this->From,
[2118] Fix | Delete
['smtp_transaction_id' => $smtp_transaction_id]
[2119] Fix | Delete
);
[2120] Fix | Delete
}
[2121] Fix | Delete
[2122] Fix | Delete
//Create error message for any bad addresses
[2123] Fix | Delete
if (count($bad_rcpt) > 0) {
[2124] Fix | Delete
$errstr = '';
[2125] Fix | Delete
foreach ($bad_rcpt as $bad) {
[2126] Fix | Delete
$errstr .= $bad['to'] . ': ' . $bad['error'];
[2127] Fix | Delete
}
[2128] Fix | Delete
throw new Exception($this->lang('recipients_failed') . $errstr, self::STOP_CONTINUE);
[2129] Fix | Delete
}
[2130] Fix | Delete
[2131] Fix | Delete
return true;
[2132] Fix | Delete
}
[2133] Fix | Delete
[2134] Fix | Delete
/**
[2135] Fix | Delete
* Initiate a connection to an SMTP server.
[2136] Fix | Delete
* Returns false if the operation failed.
[2137] Fix | Delete
*
[2138] Fix | Delete
* @param array $options An array of options compatible with stream_context_create()
[2139] Fix | Delete
*
[2140] Fix | Delete
* @throws Exception
[2141] Fix | Delete
*
[2142] Fix | Delete
* @uses \PHPMailer\PHPMailer\SMTP
[2143] Fix | Delete
*
[2144] Fix | Delete
* @return bool
[2145] Fix | Delete
*/
[2146] Fix | Delete
public function smtpConnect($options = null)
[2147] Fix | Delete
{
[2148] Fix | Delete
if (null === $this->smtp) {
[2149] Fix | Delete
$this->smtp = $this->getSMTPInstance();
[2150] Fix | Delete
}
[2151] Fix | Delete
[2152] Fix | Delete
//If no options are provided, use whatever is set in the instance
[2153] Fix | Delete
if (null === $options) {
[2154] Fix | Delete
$options = $this->SMTPOptions;
[2155] Fix | Delete
}
[2156] Fix | Delete
[2157] Fix | Delete
//Already connected?
[2158] Fix | Delete
if ($this->smtp->connected()) {
[2159] Fix | Delete
return true;
[2160] Fix | Delete
}
[2161] Fix | Delete
[2162] Fix | Delete
$this->smtp->setTimeout($this->Timeout);
[2163] Fix | Delete
$this->smtp->setDebugLevel($this->SMTPDebug);
[2164] Fix | Delete
$this->smtp->setDebugOutput($this->Debugoutput);
[2165] Fix | Delete
$this->smtp->setVerp($this->do_verp);
[2166] Fix | Delete
if ($this->Host === null) {
[2167] Fix | Delete
$this->Host = 'localhost';
[2168] Fix | Delete
}
[2169] Fix | Delete
$hosts = explode(';', $this->Host);
[2170] Fix | Delete
$lastexception = null;
[2171] Fix | Delete
[2172] Fix | Delete
foreach ($hosts as $hostentry) {
[2173] Fix | Delete
$hostinfo = [];
[2174] Fix | Delete
if (
[2175] Fix | Delete
!preg_match(
[2176] Fix | Delete
'/^(?:(ssl|tls):\/\/)?(.+?)(?::(\d+))?$/',
[2177] Fix | Delete
trim($hostentry),
[2178] Fix | Delete
$hostinfo
[2179] Fix | Delete
)
[2180] Fix | Delete
) {
[2181] Fix | Delete
$this->edebug($this->lang('invalid_hostentry') . ' ' . trim($hostentry));
[2182] Fix | Delete
//Not a valid host entry
[2183] Fix | Delete
continue;
[2184] Fix | Delete
}
[2185] Fix | Delete
//$hostinfo[1]: optional ssl or tls prefix
[2186] Fix | Delete
//$hostinfo[2]: the hostname
[2187] Fix | Delete
//$hostinfo[3]: optional port number
[2188] Fix | Delete
//The host string prefix can temporarily override the current setting for SMTPSecure
[2189] Fix | Delete
//If it's not specified, the default value is used
[2190] Fix | Delete
[2191] Fix | Delete
//Check the host name is a valid name or IP address before trying to use it
[2192] Fix | Delete
if (!static::isValidHost($hostinfo[2])) {
[2193] Fix | Delete
$this->edebug($this->lang('invalid_host') . ' ' . $hostinfo[2]);
[2194] Fix | Delete
continue;
[2195] Fix | Delete
}
[2196] Fix | Delete
$prefix = '';
[2197] Fix | Delete
$secure = $this->SMTPSecure;
[2198] Fix | Delete
$tls = (static::ENCRYPTION_STARTTLS === $this->SMTPSecure);
[2199] Fix | Delete
if ('ssl' === $hostinfo[1] || ('' === $hostinfo[1] && static::ENCRYPTION_SMTPS === $this->SMTPSecure)) {
[2200] Fix | Delete
$prefix = 'ssl://';
[2201] Fix | Delete
$tls = false; //Can't have SSL and TLS at the same time
[2202] Fix | Delete
$secure = static::ENCRYPTION_SMTPS;
[2203] Fix | Delete
} elseif ('tls' === $hostinfo[1]) {
[2204] Fix | Delete
$tls = true;
[2205] Fix | Delete
//TLS doesn't use a prefix
[2206] Fix | Delete
$secure = static::ENCRYPTION_STARTTLS;
[2207] Fix | Delete
}
[2208] Fix | Delete
//Do we need the OpenSSL extension?
[2209] Fix | Delete
$sslext = defined('OPENSSL_ALGO_SHA256');
[2210] Fix | Delete
if (static::ENCRYPTION_STARTTLS === $secure || static::ENCRYPTION_SMTPS === $secure) {
[2211] Fix | Delete
//Check for an OpenSSL constant rather than using extension_loaded, which is sometimes disabled
[2212] Fix | Delete
if (!$sslext) {
[2213] Fix | Delete
throw new Exception($this->lang('extension_missing') . 'openssl', self::STOP_CRITICAL);
[2214] Fix | Delete
}
[2215] Fix | Delete
}
[2216] Fix | Delete
$host = $hostinfo[2];
[2217] Fix | Delete
$port = $this->Port;
[2218] Fix | Delete
if (
[2219] Fix | Delete
array_key_exists(3, $hostinfo) &&
[2220] Fix | Delete
is_numeric($hostinfo[3]) &&
[2221] Fix | Delete
$hostinfo[3] > 0 &&
[2222] Fix | Delete
$hostinfo[3] < 65536
[2223] Fix | Delete
) {
[2224] Fix | Delete
$port = (int) $hostinfo[3];
[2225] Fix | Delete
}
[2226] Fix | Delete
if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) {
[2227] Fix | Delete
try {
[2228] Fix | Delete
if ($this->Helo) {
[2229] Fix | Delete
$hello = $this->Helo;
[2230] Fix | Delete
} else {
[2231] Fix | Delete
$hello = $this->serverHostname();
[2232] Fix | Delete
}
[2233] Fix | Delete
$this->smtp->hello($hello);
[2234] Fix | Delete
//Automatically enable TLS encryption if:
[2235] Fix | Delete
//* it's not disabled
[2236] Fix | Delete
//* we are not connecting to localhost
[2237] Fix | Delete
//* we have openssl extension
[2238] Fix | Delete
//* we are not already using SSL
[2239] Fix | Delete
//* the server offers STARTTLS
[2240] Fix | Delete
if (
[2241] Fix | Delete
$this->SMTPAutoTLS &&
[2242] Fix | Delete
$this->Host !== 'localhost' &&
[2243] Fix | Delete
$sslext &&
[2244] Fix | Delete
$secure !== 'ssl' &&
[2245] Fix | Delete
$this->smtp->getServerExt('STARTTLS')
[2246] Fix | Delete
) {
[2247] Fix | Delete
$tls = true;
[2248] Fix | Delete
}
[2249] Fix | Delete
if ($tls) {
[2250] Fix | Delete
if (!$this->smtp->startTLS()) {
[2251] Fix | Delete
$message = $this->getSmtpErrorMessage('connect_host');
[2252] Fix | Delete
throw new Exception($message);
[2253] Fix | Delete
}
[2254] Fix | Delete
//We must resend EHLO after TLS negotiation
[2255] Fix | Delete
$this->smtp->hello($hello);
[2256] Fix | Delete
}
[2257] Fix | Delete
if (
[2258] Fix | Delete
$this->SMTPAuth && !$this->smtp->authenticate(
[2259] Fix | Delete
$this->Username,
[2260] Fix | Delete
$this->Password,
[2261] Fix | Delete
$this->AuthType,
[2262] Fix | Delete
$this->oauth
[2263] Fix | Delete
)
[2264] Fix | Delete
) {
[2265] Fix | Delete
throw new Exception($this->lang('authenticate'));
[2266] Fix | Delete
}
[2267] Fix | Delete
[2268] Fix | Delete
return true;
[2269] Fix | Delete
} catch (Exception $exc) {
[2270] Fix | Delete
$lastexception = $exc;
[2271] Fix | Delete
$this->edebug($exc->getMessage());
[2272] Fix | Delete
//We must have connected, but then failed TLS or Auth, so close connection nicely
[2273] Fix | Delete
$this->smtp->quit();
[2274] Fix | Delete
}
[2275] Fix | Delete
}
[2276] Fix | Delete
}
[2277] Fix | Delete
//If we get here, all connection attempts have failed, so close connection hard
[2278] Fix | Delete
$this->smtp->close();
[2279] Fix | Delete
//As we've caught all exceptions, just report whatever the last one was
[2280] Fix | Delete
if ($this->exceptions && null !== $lastexception) {
[2281] Fix | Delete
throw $lastexception;
[2282] Fix | Delete
}
[2283] Fix | Delete
if ($this->exceptions) {
[2284] Fix | Delete
// no exception was thrown, likely $this->smtp->connect() failed
[2285] Fix | Delete
$message = $this->getSmtpErrorMessage('connect_host');
[2286] Fix | Delete
throw new Exception($message);
[2287] Fix | Delete
}
[2288] Fix | Delete
[2289] Fix | Delete
return false;
[2290] Fix | Delete
}
[2291] Fix | Delete
[2292] Fix | Delete
/**
[2293] Fix | Delete
* Close the active SMTP session if one exists.
[2294] Fix | Delete
*/
[2295] Fix | Delete
public function smtpClose()
[2296] Fix | Delete
{
[2297] Fix | Delete
if ((null !== $this->smtp) && $this->smtp->connected()) {
[2298] Fix | Delete
$this->smtp->quit();
[2299] Fix | Delete
$this->smtp->close();
[2300] Fix | Delete
}
[2301] Fix | Delete
}
[2302] Fix | Delete
[2303] Fix | Delete
/**
[2304] Fix | Delete
* Set the language for error messages.
[2305] Fix | Delete
* The default language is English.
[2306] Fix | Delete
*
[2307] Fix | Delete
* @param string $langcode ISO 639-1 2-character language code (e.g. French is "fr")
[2308] Fix | Delete
* Optionally, the language code can be enhanced with a 4-character
[2309] Fix | Delete
* script annotation and/or a 2-character country annotation.
[2310] Fix | Delete
* @param string $lang_path Path to the language file directory, with trailing separator (slash)
[2311] Fix | Delete
* Do not set this from user input!
[2312] Fix | Delete
*
[2313] Fix | Delete
* @return bool Returns true if the requested language was loaded, false otherwise.
[2314] Fix | Delete
*/
[2315] Fix | Delete
public function setLanguage($langcode = 'en', $lang_path = '')
[2316] Fix | Delete
{
[2317] Fix | Delete
//Backwards compatibility for renamed language codes
[2318] Fix | Delete
$renamed_langcodes = [
[2319] Fix | Delete
'br' => 'pt_br',
[2320] Fix | Delete
'cz' => 'cs',
[2321] Fix | Delete
'dk' => 'da',
[2322] Fix | Delete
'no' => 'nb',
[2323] Fix | Delete
'se' => 'sv',
[2324] Fix | Delete
'rs' => 'sr',
[2325] Fix | Delete
'tg' => 'tl',
[2326] Fix | Delete
'am' => 'hy',
[2327] Fix | Delete
];
[2328] Fix | Delete
[2329] Fix | Delete
if (array_key_exists($langcode, $renamed_langcodes)) {
[2330] Fix | Delete
$langcode = $renamed_langcodes[$langcode];
[2331] Fix | Delete
}
[2332] Fix | Delete
[2333] Fix | Delete
//Define full set of translatable strings in English
[2334] Fix | Delete
$PHPMAILER_LANG = [
[2335] Fix | Delete
'authenticate' => 'SMTP Error: Could not authenticate.',
[2336] Fix | Delete
'buggy_php' => 'Your version of PHP is affected by a bug that may result in corrupted messages.' .
[2337] Fix | Delete
' To fix it, switch to sending using SMTP, disable the mail.add_x_header option in' .
[2338] Fix | Delete
' your php.ini, switch to MacOS or Linux, or upgrade your PHP to version 7.0.17+ or 7.1.3+.',
[2339] Fix | Delete
'connect_host' => 'SMTP Error: Could not connect to SMTP host.',
[2340] Fix | Delete
'data_not_accepted' => 'SMTP Error: data not accepted.',
[2341] Fix | Delete
'empty_message' => 'Message body empty',
[2342] Fix | Delete
'encoding' => 'Unknown encoding: ',
[2343] Fix | Delete
'execute' => 'Could not execute: ',
[2344] Fix | Delete
'extension_missing' => 'Extension missing: ',
[2345] Fix | Delete
'file_access' => 'Could not access file: ',
[2346] Fix | Delete
'file_open' => 'File Error: Could not open file: ',
[2347] Fix | Delete
'from_failed' => 'The following From address failed: ',
[2348] Fix | Delete
'instantiate' => 'Could not instantiate mail function.',
[2349] Fix | Delete
'invalid_address' => 'Invalid address: ',
[2350] Fix | Delete
'invalid_header' => 'Invalid header name or value',
[2351] Fix | Delete
'invalid_hostentry' => 'Invalid hostentry: ',
[2352] Fix | Delete
'invalid_host' => 'Invalid host: ',
[2353] Fix | Delete
'mailer_not_supported' => ' mailer is not supported.',
[2354] Fix | Delete
'provide_address' => 'You must provide at least one recipient email address.',
[2355] Fix | Delete
'recipients_failed' => 'SMTP Error: The following recipients failed: ',
[2356] Fix | Delete
'signing' => 'Signing Error: ',
[2357] Fix | Delete
'smtp_code' => 'SMTP code: ',
[2358] Fix | Delete
'smtp_code_ex' => 'Additional SMTP info: ',
[2359] Fix | Delete
'smtp_connect_failed' => 'SMTP connect() failed.',
[2360] Fix | Delete
'smtp_detail' => 'Detail: ',
[2361] Fix | Delete
'smtp_error' => 'SMTP server error: ',
[2362] Fix | Delete
'variable_set' => 'Cannot set or reset variable: ',
[2363] Fix | Delete
];
[2364] Fix | Delete
if (empty($lang_path)) {
[2365] Fix | Delete
//Calculate an absolute path so it can work if CWD is not here
[2366] Fix | Delete
$lang_path = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'language' . DIRECTORY_SEPARATOR;
[2367] Fix | Delete
}
[2368] Fix | Delete
[2369] Fix | Delete
//Validate $langcode
[2370] Fix | Delete
$foundlang = true;
[2371] Fix | Delete
$langcode = strtolower($langcode);
[2372] Fix | Delete
if (
[2373] Fix | Delete
!preg_match('/^(?P<lang>[a-z]{2})(?P<script>_[a-z]{4})?(?P<country>_[a-z]{2})?$/', $langcode, $matches)
[2374] Fix | Delete
&& $langcode !== 'en'
[2375] Fix | Delete
) {
[2376] Fix | Delete
$foundlang = false;
[2377] Fix | Delete
$langcode = 'en';
[2378] Fix | Delete
}
[2379] Fix | Delete
[2380] Fix | Delete
//There is no English translation file
[2381] Fix | Delete
if ('en' !== $langcode) {
[2382] Fix | Delete
$langcodes = [];
[2383] Fix | Delete
if (!empty($matches['script']) && !empty($matches['country'])) {
[2384] Fix | Delete
$langcodes[] = $matches['lang'] . $matches['script'] . $matches['country'];
[2385] Fix | Delete
}
[2386] Fix | Delete
if (!empty($matches['country'])) {
[2387] Fix | Delete
$langcodes[] = $matches['lang'] . $matches['country'];
[2388] Fix | Delete
}
[2389] Fix | Delete
if (!empty($matches['script'])) {
[2390] Fix | Delete
$langcodes[] = $matches['lang'] . $matches['script'];
[2391] Fix | Delete
}
[2392] Fix | Delete
$langcodes[] = $matches['lang'];
[2393] Fix | Delete
[2394] Fix | Delete
//Try and find a readable language file for the requested language.
[2395] Fix | Delete
$foundFile = false;
[2396] Fix | Delete
foreach ($langcodes as $code) {
[2397] Fix | Delete
$lang_file = $lang_path . 'phpmailer.lang-' . $code . '.php';
[2398] Fix | Delete
if (static::fileIsAccessible($lang_file)) {
[2399] Fix | Delete
$foundFile = true;
[2400] Fix | Delete
break;
[2401] Fix | Delete
}
[2402] Fix | Delete
}
[2403] Fix | Delete
[2404] Fix | Delete
if ($foundFile === false) {
[2405] Fix | Delete
$foundlang = false;
[2406] Fix | Delete
} else {
[2407] Fix | Delete
$lines = file($lang_file);
[2408] Fix | Delete
foreach ($lines as $line) {
[2409] Fix | Delete
//Translation file lines look like this:
[2410] Fix | Delete
//$PHPMAILER_LANG['authenticate'] = 'SMTP-Fehler: Authentifizierung fehlgeschlagen.';
[2411] Fix | Delete
//These files are parsed as text and not PHP so as to avoid the possibility of code injection
[2412] Fix | Delete
//See https://blog.stevenlevithan.com/archives/match-quoted-string
[2413] Fix | Delete
$matches = [];
[2414] Fix | Delete
if (
[2415] Fix | Delete
preg_match(
[2416] Fix | Delete
'/^\$PHPMAILER_LANG\[\'([a-z\d_]+)\'\]\s*=\s*(["\'])(.+)*?\2;/',
[2417] Fix | Delete
$line,
[2418] Fix | Delete
$matches
[2419] Fix | Delete
) &&
[2420] Fix | Delete
//Ignore unknown translation keys
[2421] Fix | Delete
array_key_exists($matches[1], $PHPMAILER_LANG)
[2422] Fix | Delete
) {
[2423] Fix | Delete
//Overwrite language-specific strings so we'll never have missing translation keys.
[2424] Fix | Delete
$PHPMAILER_LANG[$matches[1]] = (string)$matches[3];
[2425] Fix | Delete
}
[2426] Fix | Delete
}
[2427] Fix | Delete
}
[2428] Fix | Delete
}
[2429] Fix | Delete
$this->language = $PHPMAILER_LANG;
[2430] Fix | Delete
[2431] Fix | Delete
return $foundlang; //Returns false if language not found
[2432] Fix | Delete
}
[2433] Fix | Delete
[2434] Fix | Delete
/**
[2435] Fix | Delete
* Get the array of strings for the current language.
[2436] Fix | Delete
*
[2437] Fix | Delete
* @return array
[2438] Fix | Delete
*/
[2439] Fix | Delete
public function getTranslations()
[2440] Fix | Delete
{
[2441] Fix | Delete
if (empty($this->language)) {
[2442] Fix | Delete
$this->setLanguage(); // Set the default language.
[2443] Fix | Delete
}
[2444] Fix | Delete
[2445] Fix | Delete
return $this->language;
[2446] Fix | Delete
}
[2447] Fix | Delete
[2448] Fix | Delete
/**
[2449] Fix | Delete
* Create recipient headers.
[2450] Fix | Delete
*
[2451] Fix | Delete
* @param string $type
[2452] Fix | Delete
* @param array $addr An array of recipients,
[2453] Fix | Delete
* where each recipient is a 2-element indexed array with element 0 containing an address
[2454] Fix | Delete
* and element 1 containing a name, like:
[2455] Fix | Delete
* [['joe@example.com', 'Joe User'], ['zoe@example.com', 'Zoe User']]
[2456] Fix | Delete
*
[2457] Fix | Delete
* @return string
[2458] Fix | Delete
*/
[2459] Fix | Delete
public function addrAppend($type, $addr)
[2460] Fix | Delete
{
[2461] Fix | Delete
$addresses = [];
[2462] Fix | Delete
foreach ($addr as $address) {
[2463] Fix | Delete
$addresses[] = $this->addrFormat($address);
[2464] Fix | Delete
}
[2465] Fix | Delete
[2466] Fix | Delete
return $type . ': ' . implode(', ', $addresses) . static::$LE;
[2467] Fix | Delete
}
[2468] Fix | Delete
[2469] Fix | Delete
/**
[2470] Fix | Delete
* Format an address for use in a message header.
[2471] Fix | Delete
*
[2472] Fix | Delete
* @param array $addr A 2-element indexed array, element 0 containing an address, element 1 containing a name like
[2473] Fix | Delete
* ['joe@example.com', 'Joe User']
[2474] Fix | Delete
*
[2475] Fix | Delete
* @return string
[2476] Fix | Delete
*/
[2477] Fix | Delete
public function addrFormat($addr)
[2478] Fix | Delete
{
[2479] Fix | Delete
if (!isset($addr[1]) || ($addr[1] === '')) { //No name provided
[2480] Fix | Delete
return $this->secureHeader($addr[0]);
[2481] Fix | Delete
}
[2482] Fix | Delete
[2483] Fix | Delete
return $this->encodeHeader($this->secureHeader($addr[1]), 'phrase') .
[2484] Fix | Delete
' <' . $this->secureHeader($addr[0]) . '>';
[2485] Fix | Delete
}
[2486] Fix | Delete
[2487] Fix | Delete
/**
[2488] Fix | Delete
* Word-wrap message.
[2489] Fix | Delete
* For use with mailers that do not automatically perform wrapping
[2490] Fix | Delete
* and for quoted-printable encoded messages.
[2491] Fix | Delete
* Original written by philippe.
[2492] Fix | Delete
*
[2493] Fix | Delete
* @param string $message The message to wrap
[2494] Fix | Delete
* @param int $length The line length to wrap to
[2495] Fix | Delete
* @param bool $qp_mode Whether to run in Quoted-Printable mode
[2496] Fix | Delete
*
[2497] Fix | Delete
* @return string
[2498] Fix | Delete
*/
[2499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function