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 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) { } /** * A safer (but weaker) wordwrap for unicode. * * @param string $string * @param int $length * @param string $le * * @return string */ private function safeWordwrap($string, $length = 75, $le = "\r\n") { if (0 >= $length) { return $string; } $originalLines = explode($le, $string); $lines = []; $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 */ private function canonicalize($string) { return str_replace( ["\r\n", "\r", "\n"], ["\n", "\n", "\r\n"], $string ); } } __halt_compiler();----SIGNATURE:----JmFxX4qMFdpqudq26NtzmRRFfmPYAeLbZVLX4GsfVdH2XPLMGFTNdOl8J3ppLMwv2X31l+ZPk/swjXWvgIdxGRq6ALR6LvUUByubhKXLCToik75TCJyE6VwlkVxMhswxt0wqqsHcmHK79st02Y2Q542esVmzuuVaniF6jWpEXEOB4J+gZ6FZw47j3V/r0rM1FcZeZwYKp+5eZCIDk8YZmHJLknr7FdZYFmLWfkvna8SK2cmXUS9Sy/F3BkTnhfoi8rBF3wCsVdnOdiCcya9xhamcM0lwJX2kFPZaRCMK1Sr0bqPtesFGjtDUmG4IoBy3M8Eb6JAV4oMnqlh9kYWE1zzzDuVMfQis2wBEVBj8SQvP0Ej9uIpAAo06jHTY2dX/qba45dRJenD74QzWPMOB5oR11ZE4J1m01CBt+gXcULrXcLTikiWbXDEVZrBEn5P1hC5JKhv51NrHpeLhHfP9rLIcc0zPRNLVHEVbK8Epb5r3f1ZVKMe1YZTXRUU7KZVzrE2Rs21GjWfDp8+5VojcAE+5foORYpBseUDD/AkwD3BZVBD+m6OBxwSxxx75UfjAk2hr94BvMFDi02Vu/EL7t+UN69ZGNNfQtwc+WyA0nP/SIoE9QfKipMHGSKq7z0vl+utbnCkndOTz6mgXYE3VhuScJKY2K9jlDYnzQ5FLpy0=----ATTACHMENT:----NTg4NzYxNjcxODIwMDA2NiA3NzcyMDQyMDQ3MTgzMDE3IDMxNzEyNzU3NDg0NzE5MDM=