From 07f5140771388c9e0c8a99b0dd2e5d950bdb173b Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 14 Oct 2021 15:16:42 +1100 Subject: moving h-source subdir out. --- .../Mime/ContentEncoder/Base64ContentEncoder.php | 81 ---------- .../Mime/ContentEncoder/PlainContentEncoder.php | 175 --------------------- .../Swift/Mime/ContentEncoder/QpContentEncoder.php | 117 -------------- 3 files changed, 373 deletions(-) delete mode 100755 h-source/External/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/Base64ContentEncoder.php delete mode 100755 h-source/External/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/PlainContentEncoder.php delete mode 100755 h-source/External/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php (limited to 'h-source/External/swiftmailer/lib/classes/Swift/Mime/ContentEncoder') diff --git a/h-source/External/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/Base64ContentEncoder.php b/h-source/External/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/Base64ContentEncoder.php deleted file mode 100755 index e89938e..0000000 --- a/h-source/External/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/Base64ContentEncoder.php +++ /dev/null @@ -1,81 +0,0 @@ -= $maxLineLength || 76 < $maxLineLength) - { - $maxLineLength = 76; - } - - $remainder = 0; - - while (false !== $bytes = $os->read(8190)) - { - $encoded = base64_encode($bytes); - $encodedTransformed = ''; - $thisMaxLineLength = $maxLineLength - $remainder - $firstLineOffset; - - while ($thisMaxLineLength < strlen($encoded)) - { - $encodedTransformed .= substr($encoded, 0, $thisMaxLineLength) . "\r\n"; - $firstLineOffset = 0; - $encoded = substr($encoded, $thisMaxLineLength); - $thisMaxLineLength = $maxLineLength; - $remainder = 0; - } - - if (0 < $remainingLength = strlen($encoded)) - { - $remainder += $remainingLength; - $encodedTransformed .= $encoded; - $encoded = null; - } - - $is->write($encodedTransformed); - } - } - - /** - * Get the name of this encoding scheme. - * Returns the string 'base64'. - * @return string - */ - public function getName() - { - return 'base64'; - } - -} diff --git a/h-source/External/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/PlainContentEncoder.php b/h-source/External/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/PlainContentEncoder.php deleted file mode 100755 index 4a725d8..0000000 --- a/h-source/External/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/PlainContentEncoder.php +++ /dev/null @@ -1,175 +0,0 @@ -_name = $name; - $this->_canonical = $canonical; - } - - /** - * Encode a given string to produce an encoded string. - * @param string $string - * @param int $firstLineOffset, ignored - * @param int $maxLineLength - 0 means no wrapping will occur - * @return string - */ - public function encodeString($string, $firstLineOffset = 0, - $maxLineLength = 0) - { - if ($this->_canonical) - { - $string = $this->_canonicalize($string); - } - return $this->_safeWordWrap($string, $maxLineLength, "\r\n"); - } - - /** - * Encode stream $in to stream $out. - * @param Swift_OutputByteStream $in - * @param Swift_InputByteStream $out - * @param int $firstLineOffset, ignored - * @param int $maxLineLength, optional, 0 means no wrapping will occur - */ - public function encodeByteStream( - Swift_OutputByteStream $os, Swift_InputByteStream $is, $firstLineOffset = 0, - $maxLineLength = 0) - { - $leftOver = ''; - while (false !== $bytes = $os->read(8192)) - { - $toencode = $leftOver . $bytes; - if ($this->_canonical) - { - $toencode = $this->_canonicalize($toencode); - } - $wrapped = $this->_safeWordWrap($toencode, $maxLineLength, "\r\n"); - $lastLinePos = strrpos($wrapped, "\r\n"); - $leftOver = substr($wrapped, $lastLinePos); - $wrapped = substr($wrapped, 0, $lastLinePos); - - $is->write($wrapped); - } - if (strlen($leftOver)) - { - $is->write($leftOver); - } - } - - /** - * Get the name of this encoding scheme. - * @return string - */ - public function getName() - { - return $this->_name; - } - - /** - * Not used. - */ - public function charsetChanged($charset) - { - } - - // -- Private methods - - /** - * A safer (but weaker) wordwrap for unicode. - * @param string $string - * @param int $length - * @param string $le - * @return string - * @access private - */ - private function _safeWordwrap($string, $length = 75, $le = "\r\n") - { - if (0 >= $length) - { - return $string; - } - - $originalLines = explode($le, $string); - - $lines = array(); - $lineCount = 0; - - foreach ($originalLines as $originalLine) - { - $lines[] = ''; - $currentLine =& $lines[$lineCount++]; - - //$chunks = preg_split('/(?<=[\ \t,\.!\?\-&\+\/])/', $originalLine); - $chunks = preg_split('/(?<=\s)/', $originalLine); - - foreach ($chunks as $chunk) - { - if (0 != strlen($currentLine) - && strlen($currentLine . $chunk) > $length) - { - $lines[] = ''; - $currentLine =& $lines[$lineCount++]; - } - $currentLine .= $chunk; - } - } - - return implode("\r\n", $lines); - } - - /** - * Canonicalize string input (fix CRLF). - * @param string $string - * @return string - * @access private - */ - private function _canonicalize($string) - { - return str_replace( - array("\r\n", "\r", "\n"), - array("\n", "\n", "\r\n"), - $string - ); - } - -} diff --git a/h-source/External/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php b/h-source/External/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php deleted file mode 100755 index 3beeb63..0000000 --- a/h-source/External/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php +++ /dev/null @@ -1,117 +0,0 @@ - 76 || $maxLineLength <= 0) - { - $maxLineLength = 76; - } - - $thisLineLength = $maxLineLength - $firstLineOffset; - - $this->_charStream->flushContents(); - $this->_charStream->importByteStream($os); - - $currentLine = ''; - $prepend = ''; - $size=$lineLen=0; - - while (false !== $bytes = $this->_nextSequence()) - { - //If we're filtering the input - if (isset($this->_filter)) - { - //If we can't filter because we need more bytes - while ($this->_filter->shouldBuffer($bytes)) - { - //Then collect bytes into the buffer - if (false === $moreBytes = $this->_nextSequence(1)) - { - break; - } - - foreach ($moreBytes as $b) - { - $bytes[] = $b; - } - } - //And filter them - $bytes = $this->_filter->filter($bytes); - } - - $enc = $this->_encodeByteSequence($bytes, $size); - if ($currentLine && $lineLen+$size >= $thisLineLength) - { - $is->write($prepend . $this->_standardize($currentLine)); - $currentLine = ''; - $prepend = "=\r\n"; - $thisLineLength = $maxLineLength; - $lineLen=0; - } - $lineLen+=$size; - $currentLine .= $enc; - } - if (strlen($currentLine)) - { - $is->write($prepend . $this->_standardize($currentLine)); - } - } - - /** - * Get the name of this encoding scheme. - * Returns the string 'quoted-printable'. - * @return string - */ - public function getName() - { - return 'quoted-printable'; - } - -} -- cgit v1.2.3