diff --git a/portfolio-private/PHPMailer/PHPMailer.php b/portfolio-private/PHPMailer/PHPMailer.php
index 5ccf8ff..2444bcf 100644
--- a/portfolio-private/PHPMailer/PHPMailer.php
+++ b/portfolio-private/PHPMailer/PHPMailer.php
@@ -59,7 +59,6 @@ class PHPMailer
const ICAL_METHOD_REFRESH = 'REFRESH';
const ICAL_METHOD_COUNTER = 'COUNTER';
const ICAL_METHOD_DECLINECOUNTER = 'DECLINECOUNTER';
- const RFC822_DATE_FORMAT = 'D, j M Y H:i:s O';
/**
* Email priority.
@@ -78,7 +77,7 @@ class PHPMailer
public $CharSet = self::CHARSET_ISO88591;
/**
- * The MIME Content-Type of the message.
+ * The MIME Content-type of the message.
*
* @var string
*/
@@ -160,7 +159,7 @@ class PHPMailer
public $Ical = '';
/**
- * Value-array of "method" in Content-Type header "text/calendar"
+ * Value-array of "method" in Contenttype header "text/calendar"
*
* @var string[]
*/
@@ -562,9 +561,9 @@ class PHPMailer
* string $body the email body
* string $from email address of sender
* string $extra extra information of possible use
- * 'smtp_transaction_id' => last smtp transaction id
+ * "smtp_transaction_id' => last smtp transaction id
*
- * @var callable|callable-string
+ * @var string
*/
public $action_function = '';
@@ -712,7 +711,7 @@ class PHPMailer
*
* @var array
*/
- protected static $language = [];
+ protected $language = [];
/**
* The number of errors encountered.
@@ -769,7 +768,7 @@ class PHPMailer
*
* @var string
*/
- const VERSION = '7.1.1';
+ const VERSION = '6.10.0';
/**
* Error severity: message only, continue processing.
@@ -877,7 +876,6 @@ class PHPMailer
private function mailPassthru($to, $subject, $body, $header, $params)
{
//Check overloading of mail function to avoid double-encoding
- // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecatedRemoved
if ((int)ini_get('mbstring.func_overload') & 1) {
$subject = $this->secureHeader($subject);
} else {
@@ -989,54 +987,6 @@ class PHPMailer
$this->Mailer = 'mail';
}
- /**
- * Extract sendmail path and parse to deal with known parameters.
- *
- * @param string $sendmailPath The sendmail path as set in php.ini
- *
- * @return string The sendmail path without the known parameters
- */
- private function parseSendmailPath($sendmailPath)
- {
- $sendmailPath = trim((string)$sendmailPath);
- if ($sendmailPath === '') {
- return $sendmailPath;
- }
-
- $parts = preg_split('/\s+/', $sendmailPath);
- if (empty($parts)) {
- return $sendmailPath;
- }
-
- $command = array_shift($parts);
- $remainder = [];
-
- // Parse only -t, -i, -oi and -f parameters.
- for ($i = 0; $i < count($parts); ++$i) {
- $part = $parts[$i];
- if (preg_match('/^-(i|oi|t)$/', $part, $matches)) {
- continue;
- }
- if (preg_match('/^-f(.*)$/', $part, $matches)) {
- $address = $matches[1];
- if ($address === '' && isset($parts[$i + 1]) && strpos($parts[$i + 1], '-') !== 0) {
- $address = $parts[++$i];
- }
- $this->Sender = $address;
- continue;
- }
-
- $remainder[] = $part;
- }
-
- // The params that are not parsed are added back to the command.
- if (!empty($remainder)) {
- $command .= ' ' . implode(' ', $remainder);
- }
-
- return $command;
- }
-
/**
* Send messages using $Sendmail.
*/
@@ -1045,9 +995,10 @@ class PHPMailer
$ini_sendmail_path = ini_get('sendmail_path');
if (false === stripos($ini_sendmail_path, 'sendmail')) {
- $ini_sendmail_path = '/usr/sbin/sendmail';
+ $this->Sendmail = '/usr/sbin/sendmail';
+ } else {
+ $this->Sendmail = $ini_sendmail_path;
}
- $this->Sendmail = $this->parseSendmailPath($ini_sendmail_path);
$this->Mailer = 'sendmail';
}
@@ -1059,9 +1010,10 @@ class PHPMailer
$ini_sendmail_path = ini_get('sendmail_path');
if (false === stripos($ini_sendmail_path, 'qmail')) {
- $ini_sendmail_path = '/var/qmail/bin/qmail-inject';
+ $this->Sendmail = '/var/qmail/bin/qmail-inject';
+ } else {
+ $this->Sendmail = $ini_sendmail_path;
}
- $this->Sendmail = $this->parseSendmailPath($ini_sendmail_path);
$this->Mailer = 'qmail';
}
@@ -1150,7 +1102,7 @@ class PHPMailer
//At-sign is missing.
$error_message = sprintf(
'%s (%s): %s',
- self::lang('invalid_address'),
+ $this->lang('invalid_address'),
$kind,
$address
);
@@ -1235,7 +1187,7 @@ class PHPMailer
if (!in_array($kind, ['to', 'cc', 'bcc', 'Reply-To'])) {
$error_message = sprintf(
'%s: %s',
- self::lang('Invalid recipient kind'),
+ $this->lang('Invalid recipient kind'),
$kind
);
$this->setError($error_message);
@@ -1249,7 +1201,7 @@ class PHPMailer
if (!static::validateAddress($address)) {
$error_message = sprintf(
'%s (%s): %s',
- self::lang('invalid_address'),
+ $this->lang('invalid_address'),
$kind,
$address
);
@@ -1268,62 +1220,56 @@ class PHPMailer
return true;
}
- } else {
- foreach ($this->ReplyTo as $replyTo) {
- if (0 === strcasecmp($replyTo[0], $address)) {
- return false;
- }
- }
- $this->ReplyTo[] = [$address, $name];
+ } elseif (!array_key_exists(strtolower($address), $this->ReplyTo)) {
+ $this->ReplyTo[strtolower($address)] = [$address, $name];
return true;
}
+
return false;
}
/**
* Parse and validate a string containing one or more RFC822-style comma-separated email addresses
* of the form "display name
" into an array of name/address pairs.
- * Uses the imap_rfc822_parse_adrlist function if the IMAP extension is available and
- * the deprecated $useimap argument is truthy.
+ * Uses the imap_rfc822_parse_adrlist function if the IMAP extension is available.
* Note that quotes in the name part are removed.
*
- * @deprecated This method will be removed in the next major release of PHPMailer.
* @see https://www.andrew.cmu.edu/user/agreen1/testing/mrbs/web/Mail/RFC822.php A more careful implementation
*
* @param string $addrstr The address list string
- * @param bool|null $useimap Deprecated in PHPMailer 6.11.0.
- * Truthy values request the deprecated IMAP parser
- * and trigger a deprecation warning.
+ * @param bool $useimap Whether to use the IMAP extension to parse the list
* @param string $charset The charset to use when decoding the address list string.
*
* @return array
*/
- public static function parseAddresses($addrstr, $useimap = null, $charset = self::CHARSET_ISO88591)
+ public static function parseAddresses($addrstr, $useimap = true, $charset = self::CHARSET_ISO88591)
{
- if ($useimap) {
- trigger_error(self::lang('deprecated_argument') . '$useimap', E_USER_DEPRECATED);
- }
$addresses = [];
- if ($useimap !== false && function_exists('imap_rfc822_parse_adrlist')) {
+ if ($useimap && function_exists('imap_rfc822_parse_adrlist')) {
//Use this built-in parser if it's available
- // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.imap_rfc822_parse_adrlistRemoved -- wrapped in function_exists()
$list = imap_rfc822_parse_adrlist($addrstr, '');
// Clear any potential IMAP errors to get rid of notices being thrown at end of script.
- // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.imap_errorsRemoved -- wrapped in function_exists()
imap_errors();
foreach ($list as $address) {
if (
'.SYNTAX-ERROR.' !== $address->host &&
static::validateAddress($address->mailbox . '@' . $address->host)
) {
- //Decode the name part if it's present and maybe encoded
+ //Decode the name part if it's present and encoded
if (
- property_exists($address, 'personal')
- && is_string($address->personal)
- && $address->personal !== ''
+ property_exists($address, 'personal') &&
+ //Check for a Mbstring constant rather than using extension_loaded, which is sometimes disabled
+ defined('MB_CASE_UPPER') &&
+ preg_match('/^=\?.*\?=$/s', $address->personal)
) {
- $address->personal = static::decodeHeader($address->personal, $charset);
+ $origCharset = mb_internal_encoding();
+ mb_internal_encoding($charset);
+ //Undo any RFC2047-encoded spaces-as-underscores
+ $address->personal = str_replace('_', '=20', $address->personal);
+ //Decode the name
+ $address->personal = mb_decode_mimeheader($address->personal);
+ mb_internal_encoding($origCharset);
}
$addresses[] = [
@@ -1334,51 +1280,40 @@ class PHPMailer
}
} else {
//Use this simpler parser
- $addresses = static::parseSimplerAddresses($addrstr, $charset);
- }
-
- return $addresses;
- }
-
- /**
- * Parse a string containing one or more RFC822-style comma-separated email addresses
- * with the form "display name " into an array of name/address pairs.
- * Uses a simpler parser that does not require the IMAP extension but doesnt support
- * the full RFC822 spec. For full RFC822 support, use the PHP IMAP extension.
- *
- * @param string $addrstr The address list string
- * @param string $charset The charset to use when decoding the address list string.
- *
- * @return array
- */
- protected static function parseSimplerAddresses($addrstr, $charset)
- {
- // Emit a runtime notice to recommend using the IMAP extension for full RFC822 parsing
- trigger_error(self::lang('imap_recommended'), E_USER_NOTICE);
-
- $addresses = [];
- $list = explode(',', $addrstr);
- foreach ($list as $address) {
- $address = trim($address);
- //Is there a separate name part?
- if (strpos($address, '<') === false) {
- //No separate name, just use the whole thing
- if (static::validateAddress($address)) {
- $addresses[] = [
- 'name' => '',
- 'address' => $address,
- ];
- }
- } else {
- $parsed = static::parseEmailString($address);
- $email = $parsed['email'];
- if (static::validateAddress($email)) {
- $name = static::decodeHeader($parsed['name'], $charset);
- $addresses[] = [
- //Remove any surrounding quotes and spaces from the name
- 'name' => trim($name, '\'" '),
- 'address' => $email,
- ];
+ $list = explode(',', $addrstr);
+ foreach ($list as $address) {
+ $address = trim($address);
+ //Is there a separate name part?
+ if (strpos($address, '<') === false) {
+ //No separate name, just use the whole thing
+ if (static::validateAddress($address)) {
+ $addresses[] = [
+ 'name' => '',
+ 'address' => $address,
+ ];
+ }
+ } else {
+ list($name, $email) = explode('<', $address);
+ $email = trim(str_replace('>', '', $email));
+ $name = trim($name);
+ if (static::validateAddress($email)) {
+ //Check for a Mbstring constant rather than using extension_loaded, which is sometimes disabled
+ //If this name is encoded, decode it
+ if (defined('MB_CASE_UPPER') && preg_match('/^=\?.*\?=$/s', $name)) {
+ $origCharset = mb_internal_encoding();
+ mb_internal_encoding($charset);
+ //Undo any RFC2047-encoded spaces-as-underscores
+ $name = str_replace('_', '=20', $name);
+ //Decode the name
+ $name = mb_decode_mimeheader($name);
+ mb_internal_encoding($origCharset);
+ }
+ $addresses[] = [
+ //Remove any surrounding quotes and spaces from the name
+ 'name' => trim($name, '\'" '),
+ 'address' => $email,
+ ];
+ }
}
}
}
@@ -1386,42 +1321,6 @@ class PHPMailer
return $addresses;
}
- /**
- * Parse a string containing an email address with an optional name
- * and divide it into a name and email address.
- *
- * @param string $input The email with name.
- *
- * @return array{name: string, email: string}
- */
- private static function parseEmailString($input)
- {
- $input = trim((string)$input);
-
- if ($input === '') {
- return ['name' => '', 'email' => ''];
- }
-
- $pattern = '/^\s*(?:(?:"([^"]*)"|\'([^\']*)\'|([^<]*?))\s*)?<\s*([^>]+)\s*>\s*$/';
- if (preg_match($pattern, $input, $matches)) {
- $name = '';
- // Double quotes including special scenarios.
- if (isset($matches[1]) && $matches[1] !== '') {
- $name = $matches[1];
- // Single quotes including special scenarios.
- } elseif (isset($matches[2]) && $matches[2] !== '') {
- $name = $matches[2];
- // Simplest scenario, name and email are in the format "Name ".
- } elseif (isset($matches[3])) {
- $name = trim($matches[3]);
- }
-
- return ['name' => $name, 'email' => trim($matches[4])];
- }
-
- return ['name' => '', 'email' => $input];
- }
-
/**
* Set the From and FromName properties.
*
@@ -1435,10 +1334,6 @@ class PHPMailer
*/
public function setFrom($address, $name = '', $auto = true)
{
- if (is_null($name)) {
- //Helps avoid a deprecation warning in the preg_replace() below
- $name = '';
- }
$address = trim((string)$address);
$name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
//Don't validate now addresses with IDN. Will be done in send().
@@ -1450,7 +1345,7 @@ class PHPMailer
) {
$error_message = sprintf(
'%s (From): %s',
- self::lang('invalid_address'),
+ $this->lang('invalid_address'),
$address
);
$this->setError($error_message);
@@ -1637,11 +1532,9 @@ class PHPMailer
);
} elseif (defined('INTL_IDNA_VARIANT_2003')) {
//Fall back to this old, deprecated/removed encoding
- // phpcs:ignore PHPCompatibility.Constants.RemovedConstants.intl_idna_variant_2003DeprecatedRemoved
$punycode = idn_to_ascii($domain, $errorcode, \INTL_IDNA_VARIANT_2003);
} else {
//Fall back to a default we don't know about
- // phpcs:ignore PHPCompatibility.ParameterValues.NewIDNVariantDefault.NotSet
$punycode = idn_to_ascii($domain, $errorcode);
}
if (false !== $punycode) {
@@ -1708,7 +1601,7 @@ class PHPMailer
&& ini_get('mail.add_x_header') === '1'
&& stripos(PHP_OS, 'WIN') === 0
) {
- trigger_error(self::lang('buggy_php'), E_USER_WARNING);
+ trigger_error($this->lang('buggy_php'), E_USER_WARNING);
}
try {
@@ -1738,7 +1631,7 @@ class PHPMailer
call_user_func_array([$this, 'addAnAddress'], $params);
}
if (count($this->to) + count($this->cc) + count($this->bcc) < 1) {
- throw new Exception(self::lang('provide_address'), self::STOP_CRITICAL);
+ throw new Exception($this->lang('provide_address'), self::STOP_CRITICAL);
}
//Validate From, Sender, and ConfirmReadingTo addresses
@@ -1755,7 +1648,7 @@ class PHPMailer
if (!static::validateAddress($this->{$address_kind})) {
$error_message = sprintf(
'%s (%s): %s',
- self::lang('invalid_address'),
+ $this->lang('invalid_address'),
$address_kind,
$this->{$address_kind}
);
@@ -1777,13 +1670,11 @@ class PHPMailer
$this->setMessageType();
//Refuse to send an empty message unless we are specifically allowing it
if (!$this->AllowEmpty && empty($this->Body)) {
- throw new Exception(self::lang('empty_message'), self::STOP_CRITICAL);
+ throw new Exception($this->lang('empty_message'), self::STOP_CRITICAL);
}
//Trim subject consistently
$this->Subject = trim($this->Subject);
-
-
//Create body before headers in case body makes changes to headers (e.g. altering transfer encoding)
$this->MIMEHeader = '';
$this->MIMEBody = $this->createBody();
@@ -1858,7 +1749,7 @@ class PHPMailer
return $this->mailSend($this->MIMEHeader, $this->MIMEBody);
default:
$sendMethod = $this->Mailer . 'Send';
- if (!empty($this->Mailer) && method_exists($this, $sendMethod)) {
+ if (method_exists($this, $sendMethod)) {
return $this->{$sendMethod}($this->MIMEHeader, $this->MIMEBody);
}
@@ -1911,27 +1802,23 @@ class PHPMailer
//PHP config has a sender address we can use
$this->Sender = ini_get('sendmail_from');
}
-
- $sendmailArgs = [];
-
- // CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped.
- // Also don't add the -f automatically unless it has been set either via Sender
- // or sendmail_path. Otherwise, it can introduce new problems.
- // @see http://github.com/PHPMailer/PHPMailer/issues/2298
+ //CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped.
if (!empty($this->Sender) && static::validateAddress($this->Sender) && self::isShellSafe($this->Sender)) {
- $sendmailArgs[] = '-f' . $this->Sender;
+ if ($this->Mailer === 'qmail') {
+ $sendmailFmt = '%s -f%s';
+ } else {
+ $sendmailFmt = '%s -oi -f%s -t';
+ }
+ } else {
+ //allow sendmail to choose a default envelope sender. It may
+ //seem preferable to force it to use the From header as with
+ //SMTP, but that introduces new problems (see
+ //), and
+ //it has historically worked this way.
+ $sendmailFmt = '%s -oi -t';
}
- // Qmail doesn't accept all the sendmail parameters
- // @see https://github.com/PHPMailer/PHPMailer/issues/3189
- if ($this->Mailer !== 'qmail') {
- $sendmailArgs[] = '-i';
- $sendmailArgs[] = '-t';
- }
-
- $resultArgs = (empty($sendmailArgs) ? '' : ' ' . implode(' ', $sendmailArgs));
-
- $sendmail = trim(escapeshellcmd($this->Sendmail) . $resultArgs);
+ $sendmail = sprintf($sendmailFmt, escapeshellcmd($this->Sendmail), $this->Sender);
$this->edebug('Sendmail path: ' . $this->Sendmail);
$this->edebug('Sendmail command: ' . $sendmail);
$this->edebug('Envelope sender: ' . $this->Sender);
@@ -1941,35 +1828,33 @@ class PHPMailer
foreach ($this->SingleToArray as $toAddr) {
$mail = @popen($sendmail, 'w');
if (!$mail) {
- throw new Exception(self::lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
+ throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
}
$this->edebug("To: {$toAddr}");
fwrite($mail, 'To: ' . $toAddr . "\n");
fwrite($mail, $header);
fwrite($mail, $body);
$result = pclose($mail);
- $addrinfo = static::parseAddresses($toAddr, null, $this->CharSet);
- foreach ($addrinfo as $addr) {
- $this->doCallback(
- ($result === 0),
- [[$addr['address'], $addr['name']]],
- $this->cc,
- $this->bcc,
- $this->Subject,
- $body,
- $this->From,
- []
- );
- }
+ $addrinfo = static::parseAddresses($toAddr, true, $this->CharSet);
+ $this->doCallback(
+ ($result === 0),
+ [[$addrinfo['address'], $addrinfo['name']]],
+ $this->cc,
+ $this->bcc,
+ $this->Subject,
+ $body,
+ $this->From,
+ []
+ );
$this->edebug("Result: " . ($result === 0 ? 'true' : 'false'));
if (0 !== $result) {
- throw new Exception(self::lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
+ throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
}
}
} else {
$mail = @popen($sendmail, 'w');
if (!$mail) {
- throw new Exception(self::lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
+ throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
}
fwrite($mail, $header);
fwrite($mail, $body);
@@ -1986,7 +1871,7 @@ class PHPMailer
);
$this->edebug("Result: " . ($result === 0 ? 'true' : 'false'));
if (0 !== $result) {
- throw new Exception(self::lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
+ throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
}
}
@@ -2115,8 +2000,7 @@ class PHPMailer
$this->Sender = ini_get('sendmail_from');
}
if (!empty($this->Sender) && static::validateAddress($this->Sender)) {
- $phpmailer_path = ini_get('sendmail_path');
- if (self::isShellSafe($this->Sender) && strpos($phpmailer_path, ' -f') === false) {
+ if (self::isShellSafe($this->Sender)) {
$params = sprintf('-f%s', $this->Sender);
}
$old_from = ini_get('sendmail_from');
@@ -2126,19 +2010,17 @@ class PHPMailer
if ($this->SingleTo && count($toArr) > 1) {
foreach ($toArr as $toAddr) {
$result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params);
- $addrinfo = static::parseAddresses($toAddr, null, $this->CharSet);
- foreach ($addrinfo as $addr) {
- $this->doCallback(
- $result,
- [[$addr['address'], $addr['name']]],
- $this->cc,
- $this->bcc,
- $this->Subject,
- $body,
- $this->From,
- []
- );
- }
+ $addrinfo = static::parseAddresses($toAddr, true, $this->CharSet);
+ $this->doCallback(
+ $result,
+ [[$addrinfo['address'], $addrinfo['name']]],
+ $this->cc,
+ $this->bcc,
+ $this->Subject,
+ $body,
+ $this->From,
+ []
+ );
}
} else {
$result = $this->mailPassthru($to, $this->Subject, $body, $header, $params);
@@ -2148,7 +2030,7 @@ class PHPMailer
ini_set('sendmail_from', $old_from);
}
if (!$result) {
- throw new Exception(self::lang('instantiate'), self::STOP_CRITICAL);
+ throw new Exception($this->lang('instantiate'), self::STOP_CRITICAL);
}
return true;
@@ -2234,12 +2116,12 @@ class PHPMailer
$header = static::stripTrailingWSP($header) . static::$LE . static::$LE;
$bad_rcpt = [];
if (!$this->smtpConnect($this->SMTPOptions)) {
- throw new Exception(self::lang('smtp_connect_failed'), self::STOP_CRITICAL);
+ throw new Exception($this->lang('smtp_connect_failed'), self::STOP_CRITICAL);
}
//If we have recipient addresses that need Unicode support,
//but the server doesn't support it, stop here
if ($this->UseSMTPUTF8 && !$this->smtp->getServerExt('SMTPUTF8')) {
- throw new Exception(self::lang('no_smtputf8'), self::STOP_CRITICAL);
+ throw new Exception($this->lang('no_smtputf8'), self::STOP_CRITICAL);
}
//Sender already validated in preSend()
if ('' === $this->Sender) {
@@ -2251,7 +2133,7 @@ class PHPMailer
$this->smtp->xclient($this->SMTPXClient);
}
if (!$this->smtp->mail($smtp_from)) {
- $this->setError(self::lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError()));
+ $this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError()));
throw new Exception($this->ErrorInfo, self::STOP_CRITICAL);
}
@@ -2273,7 +2155,7 @@ class PHPMailer
//Only send the DATA command if we have viable recipients
if ((count($this->all_recipients) > count($bad_rcpt)) && !$this->smtp->data($header . $body)) {
- throw new Exception(self::lang('data_not_accepted'), self::STOP_CRITICAL);
+ throw new Exception($this->lang('data_not_accepted'), self::STOP_CRITICAL);
}
$smtp_transaction_id = $this->smtp->getLastTransactionID();
@@ -2304,7 +2186,7 @@ class PHPMailer
foreach ($bad_rcpt as $bad) {
$errstr .= $bad['to'] . ': ' . $bad['error'];
}
- throw new Exception(self::lang('recipients_failed') . $errstr, self::STOP_CONTINUE);
+ throw new Exception($this->lang('recipients_failed') . $errstr, self::STOP_CONTINUE);
}
return true;
@@ -2358,7 +2240,7 @@ class PHPMailer
$hostinfo
)
) {
- $this->edebug(self::lang('invalid_hostentry') . ' ' . trim($hostentry));
+ $this->edebug($this->lang('invalid_hostentry') . ' ' . trim($hostentry));
//Not a valid host entry
continue;
}
@@ -2370,7 +2252,7 @@ class PHPMailer
//Check the host name is a valid name or IP address before trying to use it
if (!static::isValidHost($hostinfo[2])) {
- $this->edebug(self::lang('invalid_host') . ' ' . $hostinfo[2]);
+ $this->edebug($this->lang('invalid_host') . ' ' . $hostinfo[2]);
continue;
}
$prefix = '';
@@ -2390,7 +2272,7 @@ class PHPMailer
if (static::ENCRYPTION_STARTTLS === $secure || static::ENCRYPTION_SMTPS === $secure) {
//Check for an OpenSSL constant rather than using extension_loaded, which is sometimes disabled
if (!$sslext) {
- throw new Exception(self::lang('extension_missing') . 'openssl', self::STOP_CRITICAL);
+ throw new Exception($this->lang('extension_missing') . 'openssl', self::STOP_CRITICAL);
}
}
$host = $hostinfo[2];
@@ -2442,7 +2324,7 @@ class PHPMailer
$this->oauth
)
) {
- throw new Exception(self::lang('authenticate'));
+ throw new Exception($this->lang('authenticate'));
}
return true;
@@ -2492,7 +2374,7 @@ class PHPMailer
*
* @return bool Returns true if the requested language was loaded, false otherwise.
*/
- public static function setLanguage($langcode = 'en', $lang_path = '')
+ public function setLanguage($langcode = 'en', $lang_path = '')
{
//Backwards compatibility for renamed language codes
$renamed_langcodes = [
@@ -2515,7 +2397,7 @@ class PHPMailer
'authenticate' => 'SMTP Error: Could not authenticate.',
'buggy_php' => 'Your version of PHP is affected by a bug that may result in corrupted messages.' .
' To fix it, switch to sending using SMTP, disable the mail.add_x_header option in' .
- ' your php.ini, switch to macOS or Linux, or upgrade your PHP to version 7.0.17+ or 7.1.3+.',
+ ' your php.ini, switch to MacOS or Linux, or upgrade your PHP to version 7.0.17+ or 7.1.3+.',
'connect_host' => 'SMTP Error: Could not connect to SMTP host.',
'data_not_accepted' => 'SMTP Error: data not accepted.',
'empty_message' => 'Message body empty',
@@ -2541,9 +2423,6 @@ class PHPMailer
'smtp_error' => 'SMTP server error: ',
'variable_set' => 'Cannot set or reset variable: ',
'no_smtputf8' => 'Server does not support SMTPUTF8 needed to send to Unicode addresses',
- 'imap_recommended' => 'Using simplified address parser is not recommended. ' .
- 'Install the PHP IMAP extension for full RFC822 parsing.',
- 'deprecated_argument' => 'Deprecated Argument: ',
];
if (empty($lang_path)) {
//Calculate an absolute path so it can work if CWD is not here
@@ -2610,7 +2489,7 @@ class PHPMailer
}
}
}
- self::$language = $PHPMAILER_LANG;
+ $this->language = $PHPMAILER_LANG;
return $foundlang; //Returns false if language not found
}
@@ -2622,11 +2501,11 @@ class PHPMailer
*/
public function getTranslations()
{
- if (empty(self::$language)) {
- self::setLanguage(); // Set the default language.
+ if (empty($this->language)) {
+ $this->setLanguage(); // Set the default language.
}
- return self::$language;
+ return $this->language;
}
/**
@@ -2647,22 +2526,7 @@ class PHPMailer
$addresses[] = $this->addrFormat($address);
}
- //Fold between addresses so that no line exceeds the RFC 2822 line length limit
- $header = $type . ': ' . array_shift($addresses);
- $lineLength = strlen($header);
- foreach ($addresses as $address) {
- //The address goes after ', ' and must still leave room for the ',' that ends
- //the line if the next address gets folded
- if ($lineLength + strlen(', ') + strlen($address) + strlen(',') > static::MAX_LINE_LENGTH) {
- $header .= ',' . static::$LE . ' ' . $address;
- $lineLength = strlen(' ') + strlen($address);
- } else {
- $header .= ', ' . $address;
- $lineLength += strlen(', ') + strlen($address);
- }
- }
-
- return $header . static::$LE;
+ return $type . ': ' . implode(', ', $addresses) . static::$LE;
}
/**
@@ -2867,10 +2731,7 @@ class PHPMailer
{
$result = '';
- $result .= $this->headerLine(
- 'Date',
- self::sanitiseDate($this->MessageDate)
- );
+ $result .= $this->headerLine('Date', '' === $this->MessageDate ? self::rfcDate() : $this->MessageDate);
//The To header is created automatically by mail(), so needs to be omitted here
if ('mail' !== $this->Mailer) {
@@ -2939,7 +2800,7 @@ class PHPMailer
);
} elseif (is_string($this->XMailer) && trim($this->XMailer) !== '') {
//Some string
- $result .= $this->headerLine('X-Mailer', $this->secureHeader(trim($this->XMailer)));
+ $result .= $this->headerLine('X-Mailer', trim($this->XMailer));
} //Other values result in no X-Mailer header
if ('' !== $this->ConfirmReadingTo) {
@@ -2989,20 +2850,13 @@ class PHPMailer
break;
default:
//Catches case 'plain': and case '':
- $result .= $this->textLine(
- 'Content-Type: ' .
- $this->secureHeader($this->ContentType) .
- '; charset=' . $this->secureHeader($this->CharSet)
- );
+ $result .= $this->textLine('Content-Type: ' . $this->ContentType . '; charset=' . $this->CharSet);
$ismultipart = false;
break;
}
- if (!$this->validateEncoding($this->Encoding)) {
- throw new Exception(self::lang('encoding') . $this->Encoding);
- }
//RFC1341 part 5 says 7bit is assumed if not specified
if (static::ENCODING_7BIT !== $this->Encoding) {
- //RFC 2045 section 6.4 says multipart MIME parts may only use 7bit, 8bit, or binary CTE
+ //RFC 2045 section 6.4 says multipart MIME parts may only use 7bit, 8bit or binary CTE
if ($ismultipart) {
if (static::ENCODING_8BIT === $this->Encoding) {
$result .= $this->headerLine('Content-Transfer-Encoding', static::ENCODING_8BIT);
@@ -3042,7 +2896,6 @@ class PHPMailer
$bytes = '';
if (function_exists('random_bytes')) {
try {
- // phpcs:ignore PHPCompatibility.FunctionUse.NewFunctions.random_bytesFound -- Wrapped in function_exists.
$bytes = random_bytes($len);
} catch (\Exception $e) {
//Do nothing
@@ -3075,11 +2928,12 @@ class PHPMailer
//Create unique IDs and preset boundaries
$this->setBoundaries();
+ if ($this->sign_key_file) {
+ $body .= $this->getMailMIME() . static::$LE;
+ }
+
$this->setWordWrap();
- if (!$this->validateEncoding($this->Encoding)) {
- throw new Exception(self::lang('encoding') . $this->Encoding);
- }
$bodyEncoding = $this->Encoding;
$bodyCharSet = $this->CharSet;
//Can we do a 7-bit downgrade?
@@ -3109,12 +2963,6 @@ class PHPMailer
if (static::ENCODING_BASE64 !== $altBodyEncoding && static::hasLineLongerThanMax($this->AltBody)) {
$altBodyEncoding = static::ENCODING_QUOTED_PRINTABLE;
}
-
- if ($this->sign_key_file) {
- $this->Encoding = $bodyEncoding;
- $body .= $this->getMailMIME() . static::$LE;
- }
-
//Use this as a preamble in all multipart message types
$mimepre = '';
switch ($this->message_type) {
@@ -3296,12 +3144,12 @@ class PHPMailer
if ($this->isError()) {
$body = '';
if ($this->exceptions) {
- throw new Exception(self::lang('empty_message'), self::STOP_CRITICAL);
+ throw new Exception($this->lang('empty_message'), self::STOP_CRITICAL);
}
} elseif ($this->sign_key_file) {
try {
if (!defined('PKCS7_TEXT')) {
- throw new Exception(self::lang('extension_missing') . 'openssl');
+ throw new Exception($this->lang('extension_missing') . 'openssl');
}
$file = tempnam(sys_get_temp_dir(), 'srcsign');
@@ -3335,12 +3183,11 @@ class PHPMailer
@unlink($signed);
//The message returned by openssl contains both headers and body, so need to split them up
$parts = explode("\n\n", $body, 2);
- //openssl emits bare LF breaks, which SMTP servers may reject
- $this->MIMEHeader .= static::normalizeBreaks($parts[0]) . static::$LE . static::$LE;
- $body = static::normalizeBreaks($parts[1]);
+ $this->MIMEHeader .= $parts[0] . static::$LE . static::$LE;
+ $body = $parts[1];
} else {
@unlink($signed);
- throw new Exception(self::lang('signing') . openssl_error_string());
+ throw new Exception($this->lang('signing') . openssl_error_string());
}
} catch (Exception $exc) {
$body = '';
@@ -3485,7 +3332,7 @@ class PHPMailer
) {
try {
if (!static::fileIsAccessible($path)) {
- throw new Exception(self::lang('file_access') . $path, self::STOP_CONTINUE);
+ throw new Exception($this->lang('file_access') . $path, self::STOP_CONTINUE);
}
//If a MIME type is not specified, try to work it out from the file name
@@ -3498,7 +3345,7 @@ class PHPMailer
$name = $filename;
}
if (!$this->validateEncoding($encoding)) {
- throw new Exception(self::lang('encoding') . $encoding);
+ throw new Exception($this->lang('encoding') . $encoding);
}
$this->attachment[] = [
@@ -3659,11 +3506,11 @@ class PHPMailer
{
try {
if (!static::fileIsAccessible($path)) {
- throw new Exception(self::lang('file_open') . $path, self::STOP_CONTINUE);
+ throw new Exception($this->lang('file_open') . $path, self::STOP_CONTINUE);
}
$file_buffer = file_get_contents($path);
if (false === $file_buffer) {
- throw new Exception(self::lang('file_open') . $path, self::STOP_CONTINUE);
+ throw new Exception($this->lang('file_open') . $path, self::STOP_CONTINUE);
}
$file_buffer = $this->encodeString($file_buffer, $encoding);
@@ -3716,9 +3563,9 @@ class PHPMailer
$encoded = $this->encodeQP($str);
break;
default:
- $this->setError(self::lang('encoding') . $encoding);
+ $this->setError($this->lang('encoding') . $encoding);
if ($this->exceptions) {
- throw new Exception(self::lang('encoding') . $encoding);
+ throw new Exception($this->lang('encoding') . $encoding);
}
break;
}
@@ -3824,42 +3671,6 @@ class PHPMailer
return trim(static::normalizeBreaks($encoded));
}
- /**
- * Decode an RFC2047-encoded header value
- * Attempts multiple strategies so it works even when the mbstring extension is disabled.
- *
- * @param string $value The header value to decode
- * @param string $charset The target charset to convert to, defaults to ISO-8859-1 for BC
- *
- * @return string The decoded header value
- */
- public static function decodeHeader($value, $charset = self::CHARSET_ISO88591)
- {
- if (!is_string($value) || $value === '') {
- return '';
- }
- // Detect the presence of any RFC2047 encoded-words
- $hasEncodedWord = (bool) preg_match('/=\?.*\?=/s', $value);
- if ($hasEncodedWord && defined('MB_CASE_UPPER')) {
- $origCharset = mb_internal_encoding();
- // Always decode to UTF-8 to provide a consistent, modern output encoding.
- mb_internal_encoding($charset);
- if (PHP_VERSION_ID < 80300) {
- // Undo any RFC2047-encoded spaces-as-underscores.
- $value = str_replace('_', '=20', $value);
- } else {
- // PHP 8.3+ already interprets underscores as spaces. Remove additional
- // linear whitespace between adjacent encoded words to avoid double spacing.
- $value = preg_replace('/(\?=)\s+(=\?)/', '$1$2', $value);
- }
- // Decode the header value
- $value = mb_decode_mimeheader($value);
- mb_internal_encoding($origCharset);
- }
-
- return $value;
- }
-
/**
* Check if a string contains multi-byte characters.
*
@@ -4029,7 +3840,7 @@ class PHPMailer
}
if (!$this->validateEncoding($encoding)) {
- throw new Exception(self::lang('encoding') . $encoding);
+ throw new Exception($this->lang('encoding') . $encoding);
}
//Append to $attachment array
@@ -4088,7 +3899,7 @@ class PHPMailer
) {
try {
if (!static::fileIsAccessible($path)) {
- throw new Exception(self::lang('file_access') . $path, self::STOP_CONTINUE);
+ throw new Exception($this->lang('file_access') . $path, self::STOP_CONTINUE);
}
//If a MIME type is not specified, try to work it out from the file name
@@ -4097,7 +3908,7 @@ class PHPMailer
}
if (!$this->validateEncoding($encoding)) {
- throw new Exception(self::lang('encoding') . $encoding);
+ throw new Exception($this->lang('encoding') . $encoding);
}
$filename = (string) static::mb_pathinfo($path, PATHINFO_BASENAME);
@@ -4163,7 +3974,7 @@ class PHPMailer
}
if (!$this->validateEncoding($encoding)) {
- throw new Exception(self::lang('encoding') . $encoding);
+ throw new Exception($this->lang('encoding') . $encoding);
}
//Append to $attachment array
@@ -4200,7 +4011,7 @@ class PHPMailer
protected function validateEncoding($encoding)
{
return in_array(
- strtolower($encoding),
+ $encoding,
[
self::ENCODING_7BIT,
self::ENCODING_QUOTED_PRINTABLE,
@@ -4420,7 +4231,7 @@ class PHPMailer
}
if (strpbrk($name . $value, "\r\n") !== false) {
if ($this->exceptions) {
- throw new Exception(self::lang('invalid_header'));
+ throw new Exception($this->lang('invalid_header'));
}
return false;
@@ -4444,15 +4255,15 @@ class PHPMailer
if ('smtp' === $this->Mailer && null !== $this->smtp) {
$lasterror = $this->smtp->getError();
if (!empty($lasterror['error'])) {
- $msg .= ' ' . self::lang('smtp_error') . $lasterror['error'];
+ $msg .= ' ' . $this->lang('smtp_error') . $lasterror['error'];
if (!empty($lasterror['detail'])) {
- $msg .= ' ' . self::lang('smtp_detail') . $lasterror['detail'];
+ $msg .= ' ' . $this->lang('smtp_detail') . $lasterror['detail'];
}
if (!empty($lasterror['smtp_code'])) {
- $msg .= ' ' . self::lang('smtp_code') . $lasterror['smtp_code'];
+ $msg .= ' ' . $this->lang('smtp_code') . $lasterror['smtp_code'];
}
if (!empty($lasterror['smtp_code_ex'])) {
- $msg .= ' ' . self::lang('smtp_code_ex') . $lasterror['smtp_code_ex'];
+ $msg .= ' ' . $this->lang('smtp_code_ex') . $lasterror['smtp_code_ex'];
}
}
}
@@ -4460,7 +4271,7 @@ class PHPMailer
}
/**
- * Return the current date and time as an RFC 822 formatted date.
+ * Return an RFC 822 formatted date.
*
* @return string
*/
@@ -4470,51 +4281,7 @@ class PHPMailer
//Will default to UTC if it's not set properly in php.ini
date_default_timezone_set(@date_default_timezone_get());
- return date(self::RFC822_DATE_FORMAT);
- }
-
- /**
- * Normalise a user-supplied date into a correctly-formatted RFC 5322 date value
- * string suitable for use in the Date header.
- *
- * Accepts:
- * - A {@see \DateTime} (or \DateTimeImmutable) object
- * - Any date/time string understood by PHP's DateTime constructor (RFC 5322, ISO 8601,
- * Unix timestamp with leading "@", natural-language strings, etc.)
- *
- * Dates in the future are not permitted for email headers; if the parsed date is later
- * than "now" the method falls back to the current time via {@see self::rfcDate()}.
- * An empty value, a non-string/non-DateTime argument, or any value that cannot be
- * parsed will likewise fall back to {@see self::rfcDate()}.
- *
- * @param \DateTime|\DateTimeImmutable|string $date The date to normalise
- *
- * @return string An RFC 5322-formatted date string
- */
- private static function sanitiseDate($date)
- {
- try {
- //Ensure the default timezone is set properly
- date_default_timezone_set(@date_default_timezone_get());
-
- if ($date instanceof \DateTimeInterface) {
- $dt = $date;
- } elseif (is_string($date) && $date !== '') {
- $dt = new \DateTime($date);
- } else {
- //Empty string, null, or any unsupported type
- return self::rfcDate();
- }
-
- //Reject future dates — they are invalid for outgoing message headers
- if ($dt->getTimestamp() > time()) {
- return self::rfcDate();
- }
-
- return $dt->format(self::RFC822_DATE_FORMAT);
- } catch (\Exception $e) {
- return self::rfcDate();
- }
+ return date('D, j M Y H:i:s O');
}
/**
@@ -4621,21 +4388,21 @@ class PHPMailer
*
* @return string
*/
- protected static function lang($key)
+ protected function lang($key)
{
- if (count(self::$language) < 1) {
- self::setLanguage(); //Set the default language
+ if (count($this->language) < 1) {
+ $this->setLanguage(); //Set the default language
}
- if (array_key_exists($key, self::$language)) {
+ if (array_key_exists($key, $this->language)) {
if ('smtp_connect_failed' === $key) {
//Include a link to troubleshooting docs on SMTP connection failure.
//This is by far the biggest cause of support questions
//but it's usually not PHPMailer's fault.
- return self::$language[$key] . ' https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting';
+ return $this->language[$key] . ' https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting';
}
- return self::$language[$key];
+ return $this->language[$key];
}
//Return the key as a fallback
@@ -4650,7 +4417,7 @@ class PHPMailer
*/
private function getSmtpErrorMessage($base_key)
{
- $message = self::lang($base_key);
+ $message = $this->lang($base_key);
$error = $this->smtp->getError();
if (!empty($error['error'])) {
$message .= ' ' . $error['error'];
@@ -4694,7 +4461,7 @@ class PHPMailer
//Ensure name is not empty, and that neither name nor value contain line breaks
if (empty($name) || strpbrk($name . $value, "\r\n") !== false) {
if ($this->exceptions) {
- throw new Exception(self::lang('invalid_header'));
+ throw new Exception($this->lang('invalid_header'));
}
return false;
@@ -4725,10 +4492,10 @@ class PHPMailer
* Converts data-uri images into embedded attachments.
* If you don't want to apply these transformations to your HTML, just set Body and AltBody directly.
*
- * @param string $message HTML message string
- * @param string $basedir Absolute path to a base directory to prepend to relative paths to images
- * @param bool|callable $advanced Whether to use the internal HTML to text converter
- * or your own custom converter
+ * @param string $message HTML message string
+ * @param string $basedir Absolute path to a base directory to prepend to relative paths to images
+ * @param bool|callable $advanced Whether to use the internal HTML to text converter
+ * or your own custom converter
* @return string The transformed message body
*
* @throws Exception
@@ -4737,12 +4504,6 @@ class PHPMailer
*/
public function msgHTML($message, $basedir = '', $advanced = false)
{
- $cid_domain = 'phpmailer.0';
- if (filter_var($this->From, FILTER_VALIDATE_EMAIL)) {
- //prepend with a character to create valid RFC822 string in order to validate
- $cid_domain = substr($this->From, strrpos($this->From, '@') + 1);
- }
-
preg_match_all('/(? 1 && '/' !== substr($basedir, -1)) {
@@ -4764,7 +4525,7 @@ class PHPMailer
}
//Hash the decoded data, not the URL, so that the same data-URI image used in multiple places
//will only be embedded once, even if it used a different encoding
- $cid = substr(hash('sha256', $data), 0, 32) . '@' . $cid_domain; //RFC2392 S 2
+ $cid = substr(hash('sha256', $data), 0, 32) . '@phpmailer.0'; //RFC2392 S 2
if (!$this->cidExists($cid)) {
$this->addStringEmbeddedImage(
@@ -4798,7 +4559,7 @@ class PHPMailer
$directory = '';
}
//RFC2392 S 2
- $cid = substr(hash('sha256', $url), 0, 32) . '@' . $cid_domain;
+ $cid = substr(hash('sha256', $url), 0, 32) . '@phpmailer.0';
if (strlen($basedir) > 1 && '/' !== substr($basedir, -1)) {
$basedir .= '/';
}
@@ -5093,7 +4854,7 @@ class PHPMailer
return true;
}
- $this->setError(self::lang('variable_set') . $name);
+ $this->setError($this->lang('variable_set') . $name);
return false;
}
@@ -5231,7 +4992,7 @@ class PHPMailer
{
if (!defined('PKCS7_TEXT')) {
if ($this->exceptions) {
- throw new Exception(self::lang('extension_missing') . 'openssl');
+ throw new Exception($this->lang('extension_missing') . 'openssl');
}
return '';
@@ -5246,14 +5007,12 @@ class PHPMailer
}
if (openssl_sign($signHeader, $signature, $privKey, 'sha256WithRSAEncryption')) {
if (\PHP_MAJOR_VERSION < 8) {
- // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.openssl_pkey_freeDeprecated
openssl_pkey_free($privKey);
}
return base64_encode($signature);
}
if (\PHP_MAJOR_VERSION < 8) {
- // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.openssl_pkey_freeDeprecated
openssl_pkey_free($privKey);
}
diff --git a/portfolio-private/PHPMailer/SMTP.php b/portfolio-private/PHPMailer/SMTP.php
index f9dc747..7226ee9 100644
--- a/portfolio-private/PHPMailer/SMTP.php
+++ b/portfolio-private/PHPMailer/SMTP.php
@@ -34,9 +34,8 @@ class SMTP
* The PHPMailer SMTP version number.
*
* @var string
- * @deprecated This constant will be removed in PHPMailer 8.0. Use `PHPMailer::VERSION` instead.
*/
- const VERSION = '7.1.1';
+ const VERSION = '6.10.0';
/**
* SMTP line break constant.
@@ -206,7 +205,6 @@ class SMTP
'Haraka' => '/[\d]{3} Message Queued \((.*)\)/',
'ZoneMTA' => '/[\d]{3} Message queued as (.*)/',
'Mailjet' => '/[\d]{3} OK queued as (.*)/',
- 'Gsmtp' => '/[\d]{3} 2\.0\.0 OK (.*) - gsmtp/',
];
/**
@@ -275,14 +273,6 @@ class SMTP
*/
protected $last_reply = '';
- /**
- * The last command sent to the server.
- * Used to avoid sending QUIT while a DATA command is still in progress.
- *
- * @var string
- */
- protected $state = '';
-
/**
* Output debugging info via a user-selected method.
*
@@ -503,9 +493,7 @@ class SMTP
//PHP 5.6.7 dropped inclusion of TLS 1.1 and 1.2 in STREAM_CRYPTO_METHOD_TLS_CLIENT
//so add them back in manually if we can
if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {
- // phpcs:ignore PHPCompatibility.Constants.NewConstants.stream_crypto_method_tlsv1_2_clientFound
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
- // phpcs:ignore PHPCompatibility.Constants.NewConstants.stream_crypto_method_tlsv1_1_clientFound
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
}
@@ -644,49 +632,11 @@ class SMTP
if (null === $OAuth) {
return false;
}
- try {
- $oauth = $OAuth->getOauth64();
- } catch (\Exception $e) {
- // We catch all exceptions and convert them to PHPMailer exceptions to be able to
- // handle them correctly later
- throw new Exception("SMTP authentication error", 0, $e);
- }
- /*
- * An SMTP command line can have a maximum length of 512 bytes, including the command name,
- * so the base64-encoded OAUTH token has a maximum length of:
- * 512 - 13 (AUTH XOAUTH2) - 2 (CRLF) = 497 bytes
- * If the token is longer than that, the command and the token must be sent separately as described in
- * https://www.rfc-editor.org/rfc/rfc4954#section-4
- */
- if ($oauth === '') {
- //Sending an empty auth token is legitimate, but it must be encoded as '='
- //to indicate it's not a 2-part command
- if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 =', 235)) {
- return false;
- }
- } elseif (strlen($oauth) <= 497) {
- //Authenticate using a token in the initial-response part
- if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) {
- return false;
- }
- } else {
- //The token is too long, so we need to send it in two parts.
- //Send the auth command without a token and expect a 334
- if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2', 334)) {
- return false;
- }
- //Send the token
- if (!$this->sendCommand('OAuth TOKEN', $oauth, [235, 334])) {
- return false;
- }
- //If the server answers with 334, send an empty line
- //a reply other than a 235 means the authentication failed, so we don't need to send anything else
- if (
- strpos($this->last_reply, '334') === 0
- && !$this->sendCommand('AUTH End', '', 235)
- ) {
- return false;
- }
+ $oauth = $OAuth->getOauth64();
+
+ //Start authentication
+ if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) {
+ return false;
}
break;
default:
@@ -771,7 +721,6 @@ class SMTP
{
$this->server_caps = null;
$this->helo_rply = null;
- $this->state = '';
if (is_resource($this->smtp_conn)) {
//Close the connection and cleanup
fclose($this->smtp_conn);
@@ -780,25 +729,6 @@ class SMTP
}
}
- private function iterateLines($s)
- {
- $start = 0;
- $length = strlen($s);
-
- for ($i = 0; $i < $length; $i++) {
- $c = $s[$i];
- if ($c === "\n" || $c === "\r") {
- yield substr($s, $start, $i - $start);
- if ($c === "\r" && $i + 1 < $length && $s[$i + 1] === "\n") {
- $i++;
- }
- $start = $i + 1;
- }
- }
-
- yield substr($s, $start);
- }
-
/**
* Send an SMTP DATA command.
* Issues a data command and sends the msg_data to the server,
@@ -827,16 +757,15 @@ class SMTP
* NOTE: this does not count towards line-length limit.
*/
- //Iterate over lines with normalized line breaks
- $lines = $this->iterateLines($msg_data);
+ //Normalize line breaks before exploding
+ $lines = explode("\n", str_replace(["\r\n", "\r"], "\n", $msg_data));
/* To distinguish between a complete RFC822 message and a plain message body, we check if the first field
* of the first line (':' separated) does not contain a space then it _should_ be a header, and we will
* process all lines before a blank line as headers.
*/
- $first_line = $lines->current();
- $field = substr($first_line, 0, strpos($first_line, ':'));
+ $field = substr($lines[0], 0, strpos($lines[0], ':'));
$in_headers = false;
if (!empty($field) && strpos($field, ' ') === false) {
$in_headers = true;
@@ -1030,12 +959,7 @@ class SMTP
*/
public function quit($close_on_error = true)
{
- if ($this->state === 'DATA') {
- //The server would take QUIT as part of an unfinished message, so just close the connection
- $noerror = true;
- } else {
- $noerror = $this->sendCommand('QUIT', 'QUIT', 221);
- }
+ $noerror = $this->sendCommand('QUIT', 'QUIT', 221);
$err = $this->error; //Save any error
if ($noerror || $close_on_error) {
$this->close();
@@ -1138,7 +1062,6 @@ class SMTP
return false;
}
- $this->state = $command;
$this->client_send($commandstring . static::LE, $command);
$this->last_reply = $this->get_lines();
@@ -1305,7 +1228,7 @@ class SMTP
* 3. EHLO has been sent -
* $name == 'HELO'|'EHLO': returns the server name
* $name == any other string: if extension $name exists, returns True
- * or its options (e.g. AUTH mechanisms supported). Otherwise, returns False.
+ * or its options (e.g. AUTH mechanisms supported). Otherwise returns False.
*
* @param string $name Name of SMTP extension or 'HELO'|'EHLO'
*
@@ -1386,16 +1309,7 @@ class SMTP
//stream_select returns false when the `select` system call is interrupted
//by an incoming signal, try the select again
- if (
- stripos($message, 'interrupted system call') !== false ||
- (
- // on applications with a different locale than english, the message above is not found because
- // it's translated. So we also check for the SOCKET_EINTR constant which is defined under
- // Windows and UNIX-like platforms (if available on the platform).
- defined('SOCKET_EINTR') &&
- stripos($message, 'stream_select(): Unable to select [' . SOCKET_EINTR . ']') !== false
- )
- ) {
+ if (stripos($message, 'interrupted system call') !== false) {
$this->edebug(
'SMTP -> get_lines(): retrying stream_select',
self::DEBUG_LOWLEVEL
diff --git a/portfolio-private/smtp-config.example.php b/portfolio-private/smtp-config.example.php
index 2f34984..f525058 100644
--- a/portfolio-private/smtp-config.example.php
+++ b/portfolio-private/smtp-config.example.php
@@ -14,13 +14,13 @@ return [
// (Proton: Settings > All settings > Proton Mail > IMAP/SMTP > SMTP tokens).
// A @proton.me / @pm.me address will NOT work here: Proton only issues
// SMTP tokens for custom-domain addresses.
- 'smtp_user' => 'contact@your-domain.tld',
+ 'smtp_user' => 'contact@nelson-thomas.fr',
// The token itself (not your Proton password).
'smtp_token' => 'PASTE_YOUR_SMTP_TOKEN_HERE',
// Where the messages are delivered. Can be any of your addresses.
- 'to' => 'you@example.com',
+ 'to' => 'nelson.thomas.contact@domain.com',
// Only these sites may post to the form (scheme + host, no trailing slash).
'allowed_origins' => [
@@ -31,6 +31,13 @@ return [
// Anti-spam: messages allowed per visitor IP per hour.
'max_per_hour' => 5,
+ // Optional: name shown in the email ("... formulaire de contact de ").
+ // Leave empty to use the site's domain automatically.
+ 'site_name' => '',
+
+ // Time zone used for the date at the bottom of the email.
+ 'timezone' => 'Europe/Paris',
+
// Random string used to anonymise IPs in the rate-limit files.
// Generate one with: openssl rand -hex 16
'rate_salt' => 'CHANGE_ME_RANDOM_STRING',
diff --git a/www/404.html b/www/404.html
deleted file mode 100644
index 5d24097..0000000
--- a/www/404.html
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-Page not found – Nelson Thomas
-
-
-
-
-
-
-
-
-
$ traceroute this-page
-
1nelson-thomas.frokReached the site
-
2* * *404This page does not exist
-
-
Page not found
-
The link may be old or mistyped.
- Back to the portfolio
-
-
-
diff --git a/www/contact.php b/www/contact.php
index 3b803bc..344826e 100644
--- a/www/contact.php
+++ b/www/contact.php
@@ -38,7 +38,6 @@ require $private . '/PHPMailer/SMTP.php';
// ---------- Request checks ----------
if (($_SERVER['REQUEST_METHOD'] ?? '') !== 'POST') {
- header('Allow: POST');
reply(405, false, 'Method not allowed.');
}
$origin = $_SERVER['HTTP_ORIGIN'] ?? '';
@@ -62,34 +61,42 @@ function field(array $in, string $key, int $max): string
{
return mb_substr(trim((string) ($in[$key] ?? '')), 0, $max);
}
-$name = field($in, 'name', 100);
+$first = field($in, 'first_name', 60);
+$last = field($in, 'last_name', 60);
+$name = trim($first . ' ' . $last);
+$phone = field($in, 'phone', 30);
$email = field($in, 'email', 150);
$company = field($in, 'company', 100);
$subject = field($in, 'subject', 150);
$message = field($in, 'message', 4000);
// Header-bound fields must not contain line breaks (header injection).
-foreach ([$name, $email, $company, $subject] as $v) {
+foreach ([$first, $last, $email, $phone, $company, $subject] as $v) {
if (preg_match('/[\r\n]/', $v)) {
reply(400, false, 'Invalid characters in the form.');
}
}
-if ($name === '' || $subject === '' || $message === '' || !filter_var($email, FILTER_VALIDATE_EMAIL)) {
- reply(422, false, 'Fill in your name, a valid email, a subject and a message.');
+if ($first === '' || $last === '' || $subject === '' || $message === '' || !filter_var($email, FILTER_VALIDATE_EMAIL)) {
+ reply(422, false, 'Fill in the required fields (*) with a valid email address.');
+}
+if ($phone !== '' && !preg_match('/^[0-9+().\/ -]{6,30}$/', $phone)) {
+ reply(422, false, 'The phone number looks invalid.');
+}
+if (empty($in['consent'])) {
+ reply(422, false, 'Please tick the consent box so I can reply to you.');
}
// ---------- Rate limit per IP ----------
$ip = $_SERVER['REMOTE_ADDR'] ?? 'unknown';
$store = sys_get_temp_dir() . '/portfolio-contact-' . hash('sha256', $ip . ($cfg['rate_salt'] ?? ''));
$now = time();
-
-// Delete fingerprints older than one hour (as stated in the legal notice).
+$hits = [];
+// Forget visitors after one hour: delete expired rate-limit files
foreach (glob(sys_get_temp_dir() . '/portfolio-contact-*') ?: [] as $old) {
if (@filemtime($old) < $now - 3600) {
@unlink($old);
}
}
-$hits = [];
if (is_readable($store)) {
foreach (explode(',', (string) file_get_contents($store)) as $t) {
if ((int) $t > $now - 3600) {
@@ -105,15 +112,15 @@ if (count($hits) >= (int) ($cfg['max_per_hour'] ?? 5)) {
$mail = new PHPMailer(true);
try {
$mail->isSMTP();
- $mail->Host = $cfg['smtp_host'] ?? 'smtp.protonmail.ch';
- $mail->Port = (int) ($cfg['smtp_port'] ?? 587);
- $mail->SMTPSecure = $cfg['smtp_secure'] ?? PHPMailer::ENCRYPTION_STARTTLS;
+ $mail->Host = $cfg['smtp_host'] ?? 'smtp.protonmail.ch';
+ $mail->Port = (int) ($cfg['smtp_port'] ?? 587);
+ $mail->SMTPSecure = $cfg['smtp_secure'] ?? PHPMailer::ENCRYPTION_STARTTLS;
$mail->SMTPAutoTLS = $mail->SMTPSecure !== '';
- $mail->SMTPAuth = $cfg['smtp_auth'] ?? true;
- $mail->Username = $cfg['smtp_user'];
- $mail->Password = $cfg['smtp_token'];
- $mail->CharSet = PHPMailer::CHARSET_UTF8;
- $mail->Timeout = 15;
+ $mail->SMTPAuth = $cfg['smtp_auth'] ?? true;
+ $mail->Username = $cfg['smtp_user'];
+ $mail->Password = $cfg['smtp_token'];
+ $mail->CharSet = PHPMailer::CHARSET_UTF8;
+ $mail->Timeout = 15;
// Proton only accepts the address tied to the token as sender.
$mail->setFrom($cfg['smtp_user'], 'Portfolio: ' . $name);
@@ -122,14 +129,29 @@ try {
$mail->Subject = '[Portfolio] ' . $subject;
$mail->isHTML(false);
+ // Site name: from the (already validated) Origin, else the configured name
+ $site = $cfg['site_name'] ?? '';
+ if ($site === '') {
+ $site = (string) (parse_url($origin, PHP_URL_HOST) ?: ($_SERVER['HTTP_HOST'] ?? 'portfolio'));
+ }
+ date_default_timezone_set($cfg['timezone'] ?? 'Europe/Paris');
+ $line = str_repeat('-', 60);
+ $or = fn(string $v): string => $v !== '' ? $v : '-';
+ $body = str_replace(["\r\n", "\r"], "\n", $message);
+
$mail->Body =
- "New message from your portfolio\n"
- . "-------------------------------\n"
- . "Name: $name\n"
- . "Email: $email\n"
- . ($company !== '' ? "Company: $company\n" : '')
- . 'Date: ' . date('Y-m-d H:i:s T') . "\n\n"
- . $message . "\n";
+ "Nouveau message depuis le formulaire de contact de $site\n"
+ . "$line\n"
+ . "Prénom : $first\n"
+ . "Nom : $last\n"
+ . "E-mail : $email\n"
+ . 'Téléphone: ' . $or($phone) . "\n"
+ . 'Société : ' . $or($company) . "\n"
+ . "Objet : $subject\n"
+ . "$line\n\n"
+ . $body . "\n\n"
+ . "$line\n"
+ . "IP: $ip — " . date('Y-m-d H:i:s') . "\n";
$mail->send();
diff --git a/www/css/fonts.css b/www/css/fonts.css
index f7c4b73..48ed33e 100644
--- a/www/css/fonts.css
+++ b/www/css/fonts.css
@@ -1,4 +1,4 @@
-/* Self-hosted fonts (SIL Open Font License 1.1, see fonts/OFL-*.txt), from Fontsource: latin + latin-ext subsets */
+/* Self-hosted fonts (SIL Open Font License 1.1), from Fontsource */
@font-face{font-family:'Chakra Petch';font-style:normal;font-display:swap;font-weight:500;src:url(../fonts/chakra-petch-latin-ext-500-normal.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Chakra Petch';font-style:normal;font-display:swap;font-weight:500;src:url(../fonts/chakra-petch-latin-500-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Chakra Petch';font-style:normal;font-display:swap;font-weight:600;src:url(../fonts/chakra-petch-latin-ext-600-normal.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
diff --git a/www/css/style.css b/www/css/style.css
index 55dd882..59f1c6d 100644
--- a/www/css/style.css
+++ b/www/css/style.css
@@ -42,13 +42,13 @@ header{position:sticky;top:env(safe-area-inset-top,0px);z-index:10;background:co
.brand{font:600 1.05rem var(--display);letter-spacing:.02em;white-space:nowrap;color:var(--text);text-decoration:none}
nav{display:flex;gap:.25rem;overflow-x:auto;scrollbar-width:none;margin-left:auto}
nav::-webkit-scrollbar{display:none}
-nav a{position:relative;font:500 .92rem var(--body);color:var(--muted);text-decoration:none;padding:.5rem .75rem;border-radius:6px;white-space:nowrap}
+nav a{position:relative;font:500 .92rem var(--body);color:var(--muted);text-decoration:none;padding:.5rem .6rem;border-radius:6px;white-space:nowrap}
nav a:hover{color:var(--text)}
-nav a::after{content:"";position:absolute;left:.75rem;right:.75rem;bottom:.15rem;height:2px;border-radius:2px;background:var(--proton-soft);transform:scaleX(0);transition:transform .25s ease}
+nav a::after{content:"";position:absolute;left:.6rem;right:.6rem;bottom:.15rem;height:2px;border-radius:2px;background:var(--proton-soft);transform:scaleX(0);transition:transform .25s ease}
nav a.active{color:var(--text)}
nav a.active::after{transform:scaleX(1)}
header::after{content:"";position:absolute;left:0;bottom:-1px;height:1px;width:var(--progress,0%);background:var(--proton-soft)}
-.theme{display:inline-grid;place-items:center;background:none;border:1px solid var(--line);color:var(--muted);border-radius:6px;padding:.35rem .55rem;cursor:pointer;font-size:.9rem}
+.theme{background:none;border:1px solid var(--line);color:var(--muted);border-radius:6px;padding:.35rem .55rem;cursor:pointer;font-size:.9rem}
main{max-width:1080px;margin:0 auto;padding:2.5rem 1.25rem 2rem}
html{scroll-behavior:smooth;scroll-padding-top:calc(env(safe-area-inset-top,0px) + 4.5rem)}
@@ -66,7 +66,7 @@ p{margin:0 0 1rem;max-width:68ch}
/* Hero: traceroute */
.hero{display:grid;grid-template-columns:1.1fr 1fr;gap:2.5rem;align-items:center;margin-bottom:3rem}
.avatar{box-shadow:0 0 0 4px color-mix(in srgb,var(--proton) 25%,transparent);width:96px;height:96px;border-radius:50%;display:grid;place-items:center;font:700 1.8rem var(--display);
- background:var(--grad);color:#fff;margin-bottom:1.2rem}
+ background:var(--surface-2);border:2px dashed var(--todo);color:var(--todo);margin-bottom:1.2rem}
.role{font:500 1.1rem var(--display);color:var(--proton-soft);margin-bottom:1rem}
.trace{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:1.1rem 1.2rem;font:400 .86rem/1.75 var(--mono);overflow-x:auto}
.trace .cmd{color:var(--muted);margin-bottom:.4rem}
@@ -94,14 +94,22 @@ dl.star dt{color:var(--muted)} dl.star dd{margin:0}
.tags span{font-size:.8rem;padding:.15rem .55rem;border-radius:4px;background:var(--surface-2);color:var(--muted)}
.result{color:var(--signal);font-weight:500}
+.todo{border:1px dashed var(--todo);border-radius:6px;padding:.1rem .4rem;color:var(--todo);font-size:.95em}
+.item.todo-box{border-style:dashed;border-color:var(--todo)}
.sub{margin:2.5rem 0 1rem;font:600 1.25rem var(--display);color:var(--text)}
+.checklist{list-style:none;padding:0;margin:0 0 2rem;display:grid;gap:.5rem;max-width:720px}
+.checklist li{display:flex;gap:.7rem;align-items:flex-start;padding:.7rem .9rem;background:var(--surface);border:1px solid var(--line);border-radius:8px}
+.checklist .st{flex:none;width:1.3rem;height:1.3rem;border-radius:50%;border:2px solid var(--todo);margin-top:.15rem}
+.checklist .st.ok{border-color:var(--signal);background:var(--signal)}
+.video{aspect-ratio:16/9;display:grid;place-items:center;background:var(--surface-2);border:1px dashed var(--todo);border-radius:10px;color:var(--todo);text-align:center;padding:1rem}
.meter{height:10px;background:var(--surface-2);border-radius:5px;overflow:hidden;margin:.6rem 0 .3rem;max-width:520px}
.meter i{display:block;height:100%;width:0;background:var(--proton-soft)}
-.contact{display:grid;grid-template-columns:1fr 1.3fr;gap:2.5rem;align-items:start}
+.contact{max-width:760px}
+.contact .direct{display:flex;flex-wrap:wrap;gap:.6rem 1.4rem;margin:0 0 1.4rem}
.form{position:relative;background:var(--surface);border-radius:12px;padding:1.6rem;border:1px solid var(--line)}
-.field{display:grid;gap:.35rem;margin-bottom:1rem}
+.field{display:grid;gap:.35rem;margin-bottom:1rem;align-content:start}
.row{display:grid;grid-template-columns:1fr 1fr;gap:1rem}
label{font-size:.9rem;color:var(--muted)}
input,textarea{font:inherit;color:var(--text);background:var(--night);border:1px solid var(--line);border-radius:8px;padding:.65rem .8rem;width:100%}
@@ -109,25 +117,27 @@ textarea{min-height:9rem;resize:vertical}
input:focus,textarea:focus{outline:none;border-color:var(--proton-soft);box-shadow:0 0 0 3px color-mix(in srgb,var(--proton) 30%,transparent)}
input:user-invalid,textarea:user-invalid{border-color:var(--rose)}
.hp{position:absolute;left:-9999px}
-.form button{font:500 1rem var(--body);cursor:pointer;border:0;padding:.7rem 1.3rem;border-radius:8px;background:var(--proton);color:#fff;transition:background-color .2s,transform .2s}
+.form button{display:inline-flex;align-items:center;gap:.55rem;font:600 1rem var(--body);cursor:pointer;border:0;padding:.75rem 1.4rem;border-radius:8px;background:var(--proton);color:#fff;transition:background-color .2s,transform .2s}
.form button:hover{background:var(--proton-soft)}
.form button:disabled{opacity:.6;cursor:wait}
.status{margin:.9rem 0 0;font-size:.95rem;min-height:1.5em}
.status.ok{color:var(--signal)} .status.err{color:var(--rose)}
-.direct{display:grid;gap:.6rem;margin-top:1.2rem}
-@media (max-width:820px){.contact{grid-template-columns:1fr}.row{grid-template-columns:1fr}}
+.direct{display:grid;gap:.6rem}
+@media (max-width:600px){.row{grid-template-columns:1fr}}
/* Hover: frames lift slightly and pick up the Proton purple */
-.item,.trace,.form,.btn,.tags span{transition:transform .25s ease,border-color .25s ease,box-shadow .25s ease,background-color .25s ease}
+.item,.checklist li,.trace,.form,.video,.btn,.tags span{transition:transform .25s ease,border-color .25s ease,box-shadow .25s ease,background-color .25s ease}
@media (hover:hover){
- .item:hover,.trace:hover,.form:hover{transform:translateY(-3px);border-color:var(--proton-soft);
+ .item:hover,.trace:hover,.form:hover,.video:hover{transform:translateY(-3px);border-color:var(--proton-soft);
box-shadow:0 10px 28px -12px color-mix(in srgb,var(--proton) 55%,transparent)}
+ .item.todo-box:hover{border-color:var(--todo)}
+ .checklist li:hover{transform:translateX(4px);border-color:var(--proton-soft)}
.btn:hover{transform:translateY(-2px);border-color:var(--proton-soft);box-shadow:0 6px 18px -8px color-mix(in srgb,var(--proton) 70%,transparent)}
.btn.primary:hover{background:var(--proton-soft);filter:none}
.item:hover .tags span{background:color-mix(in srgb,var(--proton) 22%,var(--surface-2));color:var(--text)}
.form button:hover{transform:translateY(-1px)}
}
@media (prefers-reduced-motion:reduce){
- .item:hover,.trace:hover,.form:hover,.btn:hover,.form button:hover{transform:none}
+ .item:hover,.trace:hover,.form:hover,.video:hover,.checklist li:hover,.btn:hover,.form button:hover{transform:none}
}
.cover{display:block;width:100%;height:auto;aspect-ratio:16/9;object-fit:cover;border-radius:8px;margin-bottom:1rem;background:var(--surface-2)}
.civic-head{display:flex;justify-content:space-between;align-items:baseline;gap:.8rem}
@@ -257,7 +267,6 @@ footer p{margin:0}
@media (prefers-reduced-motion:reduce){.tool:hover,.tags.big li:hover,.foot-li:hover,.mini-tools li:hover .ic{transform:none}}
@media (max-width:820px){
.hero{grid-template-columns:1fr}
- .bar{flex-wrap:wrap} nav{margin-left:0;width:100%;order:3}
.hop{grid-template-columns:1.2rem 7.6rem 2.6rem minmax(0,1fr);gap:.45rem}
}
/* Toulouse INP N7 logo in the "Now" card (white chip so it reads in dark mode) */
@@ -373,34 +382,37 @@ dl.facts dd{margin:0}
.data-table th,.data-table td{text-align:left;vertical-align:top;padding:.6rem .7rem;border-bottom:1px solid var(--line)}
.data-table th{color:var(--muted);font-weight:500;width:34%}
@media (max-width:560px){dl.facts{grid-template-columns:1fr;gap:.15rem}dl.facts dd{margin-bottom:.6rem}.data-table th{width:auto}.legal section{padding:1.2rem}}
+/* ===== Contact form details ===== */
+.req{color:var(--proton-soft);font-weight:600}
+.field label{font-weight:500;color:var(--text)}
+.hint{font-size:.8rem;color:var(--muted)}
+.consent{display:flex;gap:.7rem;align-items:flex-start;margin:.2rem 0 1.2rem;font-size:.92rem;color:var(--muted);cursor:pointer}
+.consent input{flex:none;width:1.15rem;height:1.15rem;margin:.15rem 0 0;accent-color:var(--proton);cursor:pointer}
+.consent a{color:var(--signal)}
+.privacy-note{display:flex;gap:.55rem;align-items:flex-start;margin:1rem 0 0;font-size:.82rem;color:var(--muted)}
+.privacy-note svg{flex:none;margin-top:.15rem;color:var(--proton-soft)}
+.form .status:empty{display:none}
-/* Career cards: keep the action buttons at the bottom */
-#career .item{display:flex;flex-direction:column;align-items:flex-start}
-#career .item>.btn,#career .cv-links{margin-top:auto}
-#career .cv-links{display:flex;margin-bottom:0}
-
-/* 404 page */
-.notfound{max-width:640px;min-height:100vh;display:grid;align-content:center;gap:1.2rem;padding:2rem 1.25rem}
-.notfound h1{margin:0}
-
-/* Former inline styles (moved here so a strict Content-Security-Policy can block inline CSS) */
-.u-019d5f{left:4.76% !important;width:78.57% !important}
-.u-054622{animation-delay:.5s !important}
-.u-084650{animation-delay:1.4s !important}
-.u-2133b3{left:47.62% !important}
-.u-465ef4{object-position:50% 38% !important}
-.u-4913bb{left:9.52% !important}
-.u-51037d{width:12.5% !important}
-.u-554682{width:34.9% !important}
-.u-603952{left:66.67% !important}
-.u-6e5a89{animation-delay:1.1s !important}
-.u-6f748d{left:71.43% !important}
-.u-75bc8d{left:90.48% !important;width:9.52% !important}
-.u-7d53d2{height:20px !important;margin:4px 2px !important}
-.u-925d61{object-position:50% 12% !important}
-.u-ae93b7{animation-delay:.8s !important}
-.u-bd9c6a{left:42.86% !important}
-.u-c55905{left:21.43% !important}
-.u-cf3fb6{left:14.29% !important}
-.u-d46287{animation-delay:.2s !important}
-.u-ed50ea{left:92.86% !important}
+/* ===== Hamburger menu (phones and small tablets) ===== */
+.menu-btn{display:none;width:42px;height:38px;padding:0;border:1px solid var(--line);border-radius:8px;background:none;cursor:pointer;place-content:center;gap:5px}
+.menu-btn span{display:block;width:18px;height:2px;border-radius:2px;background:var(--text);transition:transform .25s ease,opacity .2s ease}
+.menu-btn[aria-expanded="true"] span:nth-child(1){transform:translateY(7px) rotate(45deg)}
+.menu-btn[aria-expanded="true"] span:nth-child(2){opacity:0}
+.menu-btn[aria-expanded="true"] span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}
+@media (max-width:1080px){
+ .bar{position:relative}
+ .theme{margin-left:auto}
+ .menu-btn{display:grid}
+ nav{position:absolute;left:0;right:0;top:100%;margin:0;flex-direction:column;gap:0;overflow:hidden;
+ padding:.4rem 1.25rem .9rem;background:color-mix(in srgb,var(--night) 96%,transparent);backdrop-filter:blur(10px);
+ border-bottom:1px solid var(--line);box-shadow:0 18px 30px -18px rgba(0,0,0,.6);
+ max-height:calc(100dvh - 60px);overflow-y:auto;
+ visibility:hidden;opacity:0;transform:translateY(-8px);transition:opacity .2s ease,transform .2s ease,visibility 0s linear .2s}
+ nav.open{visibility:visible;opacity:1;transform:none;transition:opacity .2s ease,transform .2s ease}
+ nav a{padding:.8rem .2rem;font-size:1rem;border-bottom:1px solid color-mix(in srgb,var(--line) 60%,transparent);border-radius:0}
+ nav a:last-child{border-bottom:0}
+ nav a::after{left:0;right:auto;width:3px;top:.75rem;bottom:.75rem;height:auto;transform:scaleY(0)}
+ nav a.active{color:var(--proton-soft);padding-left:.8rem}
+ nav a.active::after{transform:scaleY(1)}
+}
+@media (prefers-reduced-motion:reduce){nav,nav.open,.menu-btn span{transition:none}}
diff --git a/www/favicon.svg b/www/favicon.svg
deleted file mode 100644
index 810bcfd..0000000
--- a/www/favicon.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/www/fonts/OFL-ChakraPetch.txt b/www/fonts/LICENSE-chakra-petch.txt
similarity index 100%
rename from www/fonts/OFL-ChakraPetch.txt
rename to www/fonts/LICENSE-chakra-petch.txt
diff --git a/www/fonts/LICENSE-ibm-plex-mono.txt b/www/fonts/LICENSE-ibm-plex-mono.txt
new file mode 100644
index 0000000..83eac82
--- /dev/null
+++ b/www/fonts/LICENSE-ibm-plex-mono.txt
@@ -0,0 +1,93 @@
+Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-ThinItalic.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-ExtraLight.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-ExtraLightItalic.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-Light.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-LightItalic.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-Regular.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-Italic.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-Medium.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-MediumItalic.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-SemiBold.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-SemiBoldItalic.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-Bold.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-BoldItalic.ttf: Copyright 2017 IBM Corp. All rights reserved.
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/www/fonts/OFL-IBMPlex.txt b/www/fonts/LICENSE-ibm-plex-sans.txt
similarity index 100%
rename from www/fonts/OFL-IBMPlex.txt
rename to www/fonts/LICENSE-ibm-plex-sans.txt
diff --git a/www/img/og-card.png b/www/img/og-card.png
deleted file mode 100644
index beddf51..0000000
Binary files a/www/img/og-card.png and /dev/null differ
diff --git a/www/index.html b/www/index.html
index 8adb770..357213e 100644
--- a/www/index.html
+++ b/www/index.html
@@ -4,35 +4,24 @@
-
-
-
-
-
-
-
-
-
-
-
+
Nelson Thomas – ePortfolio
-
-
-
-
-
+
+
An apprenticeship question, a project, or just a chat about security? Write to me through the form below and I'll reply within a few days. Fields marked with * are required.