From a94c08223061c5511ee765434dc2523e89f895b2 Mon Sep 17 00:00:00 2001 From: saintly2k Date: Mon, 29 May 2023 23:09:55 +0200 Subject: [PATCH] Readme, PHPMailer update from 6.7.1 to 6.8.0 --- README.txt | 103 ++++++++++- software/PHPMailer/DSNConfigurator.php | 247 +++++++++++++++++++++++++ software/PHPMailer/PHPMailer.php | 4 +- software/PHPMailer/POP3.php | 2 +- software/PHPMailer/SMTP.php | 10 +- 5 files changed, 361 insertions(+), 5 deletions(-) create mode 100644 software/PHPMailer/DSNConfigurator.php diff --git a/README.txt b/README.txt index d3c16d7..34fa43f 100644 --- a/README.txt +++ b/README.txt @@ -5,4 +5,105 @@ ░███░░░█ ░███ ░███░███ ░███ ░███ ░░░░░░░░███ ░███ ░███ ░███ ░███ ░███████ ███░███ ░███ ░ ░███ ░███░░███ ███ ░███ ███ ░███ ░███ ░███ ░███ ░███ ░███░░░ ███ ░░███ █████ ░░██████ ░░░███████░ █████░░█████████ █████ █████░░████████░░██████ █████ █████ -░░░░░ ░░░░░░ ░░░░░░░ ░░░░░ ░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░░░░ ░░░░░░ ░░░░░ ░░░░░ \ No newline at end of file +░░░░░ ░░░░░░ ░░░░░░░ ░░░░░ ░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░░░░ ░░░░░░ ░░░░░ ░░░░░ + +The new, most powerful Comic- & Manga-Reader ever created by the human race. Recreated by some Otakus for Scanlation-Groups. + + ___ _ _ ___ _ _ _ + / _ \ _ _(_)__| |____|_ _|_ _ __| |_ __ _| | | + | (_) | || | / _| / /___| || ' \(_-< _/ _` | | | + \__\_\\_,_|_\__|_\_\ |___|_||_/__/\__\__,_|_|_| + +If you're too impatient and can't wait to read the documentation, here's the Quick-Install on how to do it. + +Download the latest release from GitHub and place it wherever you want it. + +To be clear, "/public/" is the webroot that should be accessible through the browser. You should *NOT* be able to access *ANYTHING* below this in your browser. + +Then open the site in your browser. You should be redirected to an installation-screen. Do everything there and you should be redirected to the empty home page (since there aren't any titles yet). + +Create an account by clicking on the top right icon (in the nucleus default theme) and hit "sign up". Fill everything out and you should be administrator as long as it's the first account in the Database. You're done now. + + ___ _ _ _ + | \ ___ __ _ _ _ __ ___ _ _| |_ __ _| |_(_)___ _ _ + | |) / _ \/ _| || | ' \/ -_) ' \ _/ _` | _| / _ \ ' \ + |___/\___/\__|\_,_|_|_|_\___|_||_\__\__,_|\__|_\___/_||_| + +I have written a very advanced (but still uncompleted) documentation. Powered by GitBook. Check it out here: + +https://fooldocs.h33t.moe + + _____ _ _ _ + |_ _| _ __ _ _ _ __| |__ _| |_(_)___ _ _ ___ + | || '_/ _` | ' \(_-< / _` | _| / _ \ ' \(_-< + |_||_| \__,_|_||_/__/_\__,_|\__|_\___/_||_/__/ + +Following translations were provided by: + +- German: Saintly2k (https://github.com/saintly2k) and Elysium (https://github.com/s-vhs) +- English: Saintly2k (https://github.com/saintly2k) + + _____ _ + |_ _| |_ ___ _ __ ___ ___ + | | | ' \/ -_) ' \/ -_|_-< + |_| |_||_\___|_|_|_\___/__/ + +Following themes were made by: + +- Nucleus: Saintly2k (https://github.com/saintly2k) and Elysium (https://github.com/s-vhs) + + ___ _ _ _ + / __|_ _ ___ __| (_) |_ ___ + | (__| '_/ -_) _` | | _(_-< + \___|_| \___\__,_|_|\__/__/ + +Main Coding: + +- Saintly2k (https://github.com/saintly2k) +- Elysium (https://github.com/s-vhs) + +Additional contributions: + +- Kaligula (https://github.com/kaligula-eu) + + ___ _ + / __|_ _ _ __ _ __ ___ _ _| |_ + \__ \ || | '_ \ '_ \/ _ \ '_| _| + |___/\_,_| .__/ .__/\___/_| \__| + |_| |_| +Join our Discord to receive support and hang out with awesome people: + +https://discord.gg/uahG2fKVvg + + ___ _ + | \ ___ _ _ __ _| |_ ___ + | |) / _ \ ' \/ _` | _/ -_) + |___/\___/_||_\__,_|\__\___| + +Donating means a lot to me, since with this money I can pay the servers (which I am currently with my own money). If you donate, you get a cool role on the Discord and have my eternal gatitude. You can also suggest some features for this and other software I make and I'll see what I can do :D + +- Ko-fi: https://ko-fi.com/saintly +- PayPal: https://paypal.me/WOLFRAMEdev + + _____ _ _ _ + |_ _|__ __| |_ _ _ ___| |___ __ _(_)___ ___ + | |/ -_) _| ' \| ' \/ _ \ / _ \/ _` | / -_|_-< + |_|\___\__|_||_|_||_\___/_\___/\__, |_\___/__/ + +Several other softwares and scripts were used in FoOlSlide to optimize it as much as possible. + +- PHP (https://www.php.net) (7.4) +- HTML Purifier (http://htmlpurifier.org) (4.15.0) +- PHPMailer/PHPMailer (https://github.com/PHPMailer/PHPMailer) (6.8.0) +- rakibtg/SleekDB (https://github.com/rakibtg/SleekDB) (2.15) +- smarty-php/smarty (https://github.com/smarty-php/smarty) (v4.3.1) +- erusev/parsedown (https://github.com/erusev/parsedown) (1.7.4) + + _ _ + | | (_)__ ___ _ _ __ ___ + | |__| / _/ -_) ' \/ _/ -_) + |____|_\__\___|_||_\__\___| + +This software is used under the GPL-3.0 license. See more: + +https://github.com/saintly2k/FoOlSlideX/blob/master/LICENSE \ No newline at end of file diff --git a/software/PHPMailer/DSNConfigurator.php b/software/PHPMailer/DSNConfigurator.php new file mode 100644 index 0000000..ab707d2 --- /dev/null +++ b/software/PHPMailer/DSNConfigurator.php @@ -0,0 +1,247 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2023 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +namespace PHPMailer\PHPMailer; + +/** + * Configure PHPMailer with DSN string. + * + * @see https://en.wikipedia.org/wiki/Data_source_name + * + * @author Oleg Voronkovich + */ +class DSNConfigurator +{ + /** + * Create new PHPMailer instance configured by DSN. + * + * @param string $dsn DSN + * @param bool $exceptions Should we throw external exceptions? + * + * @return PHPMailer + */ + public static function mailer($dsn, $exceptions = null) + { + static $configurator = null; + + if (null === $configurator) { + $configurator = new DSNConfigurator(); + } + + return $configurator->configure(new PHPMailer($exceptions), $dsn); + } + + /** + * Configure PHPMailer instance with DSN string. + * + * @param PHPMailer $mailer PHPMailer instance + * @param string $dsn DSN + * + * @return PHPMailer + */ + public function configure(PHPMailer $mailer, $dsn) + { + $config = $this->parseDSN($dsn); + + $this->applyConfig($mailer, $config); + + return $mailer; + } + + /** + * Parse DSN string. + * + * @param string $dsn DSN + * + * @throws Exception If DSN is malformed + * + * @return array Configuration + */ + private function parseDSN($dsn) + { + $config = $this->parseUrl($dsn); + + if (false === $config || !isset($config['scheme']) || !isset($config['host'])) { + throw new Exception( + sprintf('Malformed DSN: "%s".', $dsn) + ); + } + + if (isset($config['query'])) { + parse_str($config['query'], $config['query']); + } + + return $config; + } + + /** + * Apply configuration to mailer. + * + * @param PHPMailer $mailer PHPMailer instance + * @param array $config Configuration + * + * @throws Exception If scheme is invalid + */ + private function applyConfig(PHPMailer $mailer, $config) + { + switch ($config['scheme']) { + case 'mail': + $mailer->isMail(); + break; + case 'sendmail': + $mailer->isSendmail(); + break; + case 'qmail': + $mailer->isQmail(); + break; + case 'smtp': + case 'smtps': + $mailer->isSMTP(); + $this->configureSMTP($mailer, $config); + break; + default: + throw new Exception( + sprintf( + 'Invalid scheme: "%s". Allowed values: "mail", "sendmail", "qmail", "smtp", "smtps".', + $config['scheme'] + ) + ); + } + + if (isset($config['query'])) { + $this->configureOptions($mailer, $config['query']); + } + } + + /** + * Configure SMTP. + * + * @param PHPMailer $mailer PHPMailer instance + * @param array $config Configuration + */ + private function configureSMTP($mailer, $config) + { + $isSMTPS = 'smtps' === $config['scheme']; + + if ($isSMTPS) { + $mailer->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; + } + + $mailer->Host = $config['host']; + + if (isset($config['port'])) { + $mailer->Port = $config['port']; + } elseif ($isSMTPS) { + $mailer->Port = SMTP::DEFAULT_SECURE_PORT; + } + + $mailer->SMTPAuth = isset($config['user']) || isset($config['pass']); + + if (isset($config['user'])) { + $mailer->Username = $config['user']; + } + + if (isset($config['pass'])) { + $mailer->Password = $config['pass']; + } + } + + /** + * Configure options. + * + * @param PHPMailer $mailer PHPMailer instance + * @param array $options Options + * + * @throws Exception If option is unknown + */ + private function configureOptions(PHPMailer $mailer, $options) + { + $allowedOptions = get_object_vars($mailer); + + unset($allowedOptions['Mailer']); + unset($allowedOptions['SMTPAuth']); + unset($allowedOptions['Username']); + unset($allowedOptions['Password']); + unset($allowedOptions['Hostname']); + unset($allowedOptions['Port']); + unset($allowedOptions['ErrorInfo']); + + $allowedOptions = \array_keys($allowedOptions); + + foreach ($options as $key => $value) { + if (!in_array($key, $allowedOptions)) { + throw new Exception( + sprintf( + 'Unknown option: "%s". Allowed values: "%s"', + $key, + implode('", "', $allowedOptions) + ) + ); + } + + switch ($key) { + case 'AllowEmpty': + case 'SMTPAutoTLS': + case 'SMTPKeepAlive': + case 'SingleTo': + case 'UseSendmailOptions': + case 'do_verp': + case 'DKIM_copyHeaderFields': + $mailer->$key = (bool) $value; + break; + case 'Priority': + case 'SMTPDebug': + case 'WordWrap': + $mailer->$key = (int) $value; + break; + default: + $mailer->$key = $value; + break; + } + } + } + + /** + * Parse a URL. + * Wrapper for the built-in parse_url function to work around a bug in PHP 5.5. + * + * @param string $url URL + * + * @return array|false + */ + protected function parseUrl($url) + { + if (\PHP_VERSION_ID >= 50600 || false === strpos($url, '?')) { + return parse_url($url); + } + + $chunks = explode('?', $url); + if (is_array($chunks)) { + $result = parse_url($chunks[0]); + if (is_array($result)) { + $result['query'] = $chunks[1]; + } + return $result; + } + + return false; + } +} diff --git a/software/PHPMailer/PHPMailer.php b/software/PHPMailer/PHPMailer.php index e14cdbf..a644d2c 100644 --- a/software/PHPMailer/PHPMailer.php +++ b/software/PHPMailer/PHPMailer.php @@ -750,7 +750,7 @@ class PHPMailer * * @var string */ - const VERSION = '6.7.1'; + const VERSION = '6.8.0'; /** * Error severity: message only, continue processing. @@ -2423,7 +2423,7 @@ class PHPMailer */ public function addrFormat($addr) { - if (empty($addr[1])) { //No name provided + if (!isset($addr[1]) || ($addr[1] === '')) { //No name provided return $this->secureHeader($addr[0]); } diff --git a/software/PHPMailer/POP3.php b/software/PHPMailer/POP3.php index 4ae52fb..d025689 100644 --- a/software/PHPMailer/POP3.php +++ b/software/PHPMailer/POP3.php @@ -46,7 +46,7 @@ class POP3 * * @var string */ - const VERSION = '6.7.1'; + const VERSION = '6.8.0'; /** * Default POP3 port number. diff --git a/software/PHPMailer/SMTP.php b/software/PHPMailer/SMTP.php index 95b0d0b..fc4b781 100644 --- a/software/PHPMailer/SMTP.php +++ b/software/PHPMailer/SMTP.php @@ -35,7 +35,7 @@ class SMTP * * @var string */ - const VERSION = '6.7.1'; + const VERSION = '6.8.0'; /** * SMTP line break constant. @@ -51,6 +51,13 @@ class SMTP */ const DEFAULT_PORT = 25; + /** + * The SMTPs port to use if one is not specified. + * + * @var int + */ + const DEFAULT_SECURE_PORT = 465; + /** * The maximum line length allowed by RFC 5321 section 4.5.3.1.6, * *excluding* a trailing CRLF break. @@ -187,6 +194,7 @@ class SMTP 'SendGrid' => '/[\d]{3} Ok: queued as (.*)/', 'CampaignMonitor' => '/[\d]{3} 2.0.0 OK:([a-zA-Z\d]{48})/', 'Haraka' => '/[\d]{3} Message Queued \((.*)\)/', + 'ZoneMTA' => '/[\d]{3} Message queued as (.*)/', 'Mailjet' => '/[\d]{3} OK queued as (.*)/', ];