Changeset 11341
- Timestamp:
- 05/15/2009 05:32:35 PM (15 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-phpmailer.php
r11195 r11341 3 3 .---------------------------------------------------------------------------. 4 4 | Software: PHPMailer - PHP email class | 5 | Version: 2.0. 2|5 | Version: 2.0.4 | 6 6 | Contact: via sourceforge.net support pages (also www.codeworxtech.com) | 7 7 | Info: http://phpmailer.sourceforge.net | … … 29 29 * @package PHPMailer 30 30 * @author Andy Prevost 31 * @copyright 2004 - 200 8Andy Prevost31 * @copyright 2004 - 2009 Andy Prevost 32 32 */ 33 33 … … 140 140 * @var string 141 141 */ 142 var $Version = "2.0. 2";142 var $Version = "2.0.4"; 143 143 144 144 /** … … 258 258 var $error_count = 0; 259 259 var $LE = "\n"; 260 var $sign_cert_file = ""; 260 261 var $sign_key_file = ""; 261 262 var $sign_key_pass = ""; … … 650 651 include($lang_path.'phpmailer.lang-en.php'); 651 652 } else { 652 $this->SetError('Could not load language file'); 653 return false; 653 $PHPMAILER_LANG = array(); 654 $PHPMAILER_LANG["provide_address"] = 'You must provide at least one ' . 655 $PHPMAILER_LANG["mailer_not_supported"] = ' mailer is not supported.'; 656 $PHPMAILER_LANG["execute"] = 'Could not execute: '; 657 $PHPMAILER_LANG["instantiate"] = 'Could not instantiate mail function.'; 658 $PHPMAILER_LANG["authenticate"] = 'SMTP Error: Could not authenticate.'; 659 $PHPMAILER_LANG["from_failed"] = 'The following From address failed: '; 660 $PHPMAILER_LANG["recipients_failed"] = 'SMTP Error: The following ' . 661 $PHPMAILER_LANG["data_not_accepted"] = 'SMTP Error: Data not accepted.'; 662 $PHPMAILER_LANG["connect_host"] = 'SMTP Error: Could not connect to SMTP host.'; 663 $PHPMAILER_LANG["file_access"] = 'Could not access file: '; 664 $PHPMAILER_LANG["file_open"] = 'File Error: Could not open file: '; 665 $PHPMAILER_LANG["encoding"] = 'Unknown encoding: '; 666 $PHPMAILER_LANG["signing"] = 'Signing Error: '; 654 667 } 655 668 $this->language = $PHPMAILER_LANG; … … 865 878 $result .= $this->HeaderLine('To', 'undisclosed-recipients:;'); 866 879 } 867 if(count($this->cc) > 0) {868 $result .= $this->AddrAppend('Cc', $this->cc);869 }870 880 } 871 881 … … 1008 1018 $signed = tempnam("", "signed"); 1009 1019 1010 if (@openssl_pkcs7_sign($file, $signed, "file://".$this->sign_ key_file, array("file://".$this->sign_key_file, $this->sign_key_pass), null)) {1020 if (@openssl_pkcs7_sign($file, $signed, "file://".$this->sign_cert_file, array("file://".$this->sign_key_file, $this->sign_key_pass), null)) { 1011 1021 $fp = fopen($signed, "r"); 1012 1022 $result = fread($fp, filesize($this->sign_key_file)); 1023 $result = ''; 1024 while(!feof($fp)){ 1025 $result = $result . fread($fp, 1024); 1026 } 1013 1027 fclose($fp); 1014 1028 } else { … … 1160 1174 1161 1175 $mime[] = sprintf("--%s%s", $this->boundary[1], $this->LE); 1162 $mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $ name, $this->LE);1176 $mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $this->EncodeHeader($this->SecureHeader($name)), $this->LE); 1163 1177 $mime[] = sprintf("Content-Transfer-Encoding: %s%s", $encoding, $this->LE); 1164 1178 … … 1167 1181 } 1168 1182 1169 $mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s", $disposition, $ name, $this->LE.$this->LE);1183 $mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s", $disposition, $this->EncodeHeader($this->SecureHeader($name)), $this->LE.$this->LE); 1170 1184 1171 1185 /* Encode as string attachment */ … … 1400 1414 $output .= $newline.$eol; 1401 1415 } // end of while 1402 return trim($output);1416 return $output; 1403 1417 } 1404 1418 … … 1409 1423 */ 1410 1424 function EncodeQ_callback ($matches) { 1411 return "=".sprintf("%02X", ord($matches[1]));1425 return sprintf('=%02X', ord($matches[1])); 1412 1426 } 1413 1427 … … 1723 1737 $mimeType = $this->_mime_types($ext); 1724 1738 if ( strlen($basedir) > 1 && substr($basedir,-1) != '/') { $basedir .= '/'; } 1725 if ( strlen($directory) > 1 && substr($basedir,-1) != '/') { $directory .= '/'; } 1726 $this->AddEmbeddedImage($basedir.$directory.$filename, md5($filename), $filename, 'base64', $mimeType); 1739 if ( strlen($directory) > 1 && substr($directory,-1) != '/') { $directory .= '/'; } 1727 1740 if ( $this->AddEmbeddedImage($basedir.$directory.$filename, md5($filename), $filename, 'base64',$mimeType) ) { 1728 1741 $message = preg_replace("/".$images[1][$i]."=\"".preg_quote($url, '/')."\"/Ui", $images[1][$i]."=\"".$cid."\"", $message); … … 1735 1748 $textMsg = trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/s','',$message))); 1736 1749 if ( !empty($textMsg) && empty($this->AltBody) ) { 1737 $this->AltBody = $textMsg;1750 $this->AltBody = html_entity_decode($textMsg); 1738 1751 } 1739 1752 if ( empty($this->AltBody) ) { … … 1749 1762 function _mime_types($ext = '') { 1750 1763 $mimes = array( 1751 'hqx' => 'application/mac-binhex40', 1764 'ai' => 'application/postscript', 1765 'aif' => 'audio/x-aiff', 1766 'aifc' => 'audio/x-aiff', 1767 'aiff' => 'audio/x-aiff', 1768 'avi' => 'video/x-msvideo', 1769 'bin' => 'application/macbinary', 1770 'bmp' => 'image/bmp', 1771 'class' => 'application/octet-stream', 1752 1772 'cpt' => 'application/mac-compactpro', 1773 'css' => 'text/css', 1774 'dcr' => 'application/x-director', 1775 'dir' => 'application/x-director', 1776 'dll' => 'application/octet-stream', 1777 'dms' => 'application/octet-stream', 1753 1778 'doc' => 'application/msword', 1754 'bin' => 'application/macbinary', 1755 'dms' => 'application/octet-stream', 1779 'dvi' => 'application/x-dvi', 1780 'dxr' => 'application/x-director', 1781 'eml' => 'message/rfc822', 1782 'eps' => 'application/postscript', 1783 'exe' => 'application/octet-stream', 1784 'gif' => 'image/gif', 1785 'gtar' => 'application/x-gtar', 1786 'htm' => 'text/html', 1787 'html' => 'text/html', 1788 'jpe' => 'image/jpeg', 1789 'jpeg' => 'image/jpeg', 1790 'jpg' => 'image/jpeg', 1791 'hqx' => 'application/mac-binhex40', 1792 'js' => 'application/x-javascript', 1756 1793 'lha' => 'application/octet-stream', 1794 'log' => 'text/plain', 1757 1795 'lzh' => 'application/octet-stream', 1758 'exe' => 'application/octet-stream', 1759 'class' => 'application/octet-stream', 1760 'psd' => 'application/octet-stream', 1761 'so' => 'application/octet-stream', 1762 'sea' => 'application/octet-stream', 1763 'dll' => 'application/octet-stream', 1796 'mid' => 'audio/midi', 1797 'midi' => 'audio/midi', 1798 'mif' => 'application/vnd.mif', 1799 'mov' => 'video/quicktime', 1800 'movie' => 'video/x-sgi-movie', 1801 'mp2' => 'audio/mpeg', 1802 'mp3' => 'audio/mpeg', 1803 'mpe' => 'video/mpeg', 1804 'mpeg' => 'video/mpeg', 1805 'mpg' => 'video/mpeg', 1806 'mpga' => 'audio/mpeg', 1764 1807 'oda' => 'application/oda', 1765 1808 'pdf' => 'application/pdf', 1766 'ai' => 'application/postscript', 1767 'eps' => 'application/postscript', 1809 'php' => 'application/x-httpd-php', 1810 'php3' => 'application/x-httpd-php', 1811 'php4' => 'application/x-httpd-php', 1812 'phps' => 'application/x-httpd-php-source', 1813 'phtml' => 'application/x-httpd-php', 1814 'png' => 'image/png', 1815 'ppt' => 'application/vnd.ms-powerpoint', 1768 1816 'ps' => 'application/postscript', 1769 'smi' => 'application/smil', 1770 'smil' => 'application/smil', 1771 'mif' => 'application/vnd.mif', 1772 'xls' => 'application/vnd.ms-excel', 1773 'ppt' => 'application/vnd.ms-powerpoint', 1774 'wbxml' => 'application/vnd.wap.wbxml', 1775 'wmlc' => 'application/vnd.wap.wmlc', 1776 'dcr' => 'application/x-director', 1777 'dir' => 'application/x-director', 1778 'dxr' => 'application/x-director', 1779 'dvi' => 'application/x-dvi', 1780 'gtar' => 'application/x-gtar', 1781 'php' => 'application/x-httpd-php', 1782 'php4' => 'application/x-httpd-php', 1783 'php3' => 'application/x-httpd-php', 1784 'phtml' => 'application/x-httpd-php', 1785 'phps' => 'application/x-httpd-php-source', 1786 'js' => 'application/x-javascript', 1787 'swf' => 'application/x-shockwave-flash', 1788 'sit' => 'application/x-stuffit', 1789 'tar' => 'application/x-tar', 1790 'tgz' => 'application/x-tar', 1791 'xhtml' => 'application/xhtml+xml', 1792 'xht' => 'application/xhtml+xml', 1793 'zip' => 'application/zip', 1794 'mid' => 'audio/midi', 1795 'midi' => 'audio/midi', 1796 'mpga' => 'audio/mpeg', 1797 'mp2' => 'audio/mpeg', 1798 'mp3' => 'audio/mpeg', 1799 'aif' => 'audio/x-aiff', 1800 'aiff' => 'audio/x-aiff', 1801 'aifc' => 'audio/x-aiff', 1817 'psd' => 'application/octet-stream', 1818 'qt' => 'video/quicktime', 1819 'ra' => 'audio/x-realaudio', 1802 1820 'ram' => 'audio/x-pn-realaudio', 1803 1821 'rm' => 'audio/x-pn-realaudio', 1804 1822 'rpm' => 'audio/x-pn-realaudio-plugin', 1805 'ra' => 'audio/x-realaudio', 1823 'rtf' => 'text/rtf', 1824 'rtx' => 'text/richtext', 1806 1825 'rv' => 'video/vnd.rn-realvideo', 1826 'sea' => 'application/octet-stream', 1827 'shtml' => 'text/html', 1828 'sit' => 'application/x-stuffit', 1829 'so' => 'application/octet-stream', 1830 'smi' => 'application/smil', 1831 'smil' => 'application/smil', 1832 'swf' => 'application/x-shockwave-flash', 1833 'tar' => 'application/x-tar', 1834 'text' => 'text/plain', 1835 'txt' => 'text/plain', 1836 'tgz' => 'application/x-tar', 1837 'tif' => 'image/tiff', 1838 'tiff' => 'image/tiff', 1807 1839 'wav' => 'audio/x-wav', 1808 'bmp' => 'image/bmp', 1809 'gif' => 'image/gif', 1810 'jpeg' => 'image/jpeg', 1811 'jpg' => 'image/jpeg', 1812 'jpe' => 'image/jpeg', 1813 'png' => 'image/png', 1814 'tiff' => 'image/tiff', 1815 'tif' => 'image/tiff', 1816 'css' => 'text/css', 1817 'html' => 'text/html', 1818 'htm' => 'text/html', 1819 'shtml' => 'text/html', 1820 'txt' => 'text/plain', 1821 'text' => 'text/plain', 1822 'log' => 'text/plain', 1823 'rtx' => 'text/richtext', 1824 'rtf' => 'text/rtf', 1840 'wbxml' => 'application/vnd.wap.wbxml', 1841 'wmlc' => 'application/vnd.wap.wmlc', 1842 'word' => 'application/msword', 1843 'xht' => 'application/xhtml+xml', 1844 'xhtml' => 'application/xhtml+xml', 1845 'xl' => 'application/excel', 1846 'xls' => 'application/vnd.ms-excel', 1825 1847 'xml' => 'text/xml', 1826 1848 'xsl' => 'text/xml', 1827 'mpeg' => 'video/mpeg', 1828 'mpg' => 'video/mpeg', 1829 'mpe' => 'video/mpeg', 1830 'qt' => 'video/quicktime', 1831 'mov' => 'video/quicktime', 1832 'avi' => 'video/x-msvideo', 1833 'movie' => 'video/x-sgi-movie', 1834 'doc' => 'application/msword', 1835 'word' => 'application/msword', 1836 'xl' => 'application/excel', 1837 'eml' => 'message/rfc822' 1849 'zip' => 'application/zip' 1838 1850 ); 1839 1851 return ( ! isset($mimes[strtolower($ext)])) ? 'application/octet-stream' : $mimes[strtolower($ext)]; … … 1899 1911 * @param string $key_pass Password for private key 1900 1912 */ 1901 function Sign($key_filename, $key_pass) { 1913 function Sign($cert_filename, $key_filename, $key_pass) { 1914 $this->sign_cert_file = $cert_filename; 1902 1915 $this->sign_key_file = $key_filename; 1903 1916 $this->sign_key_pass = $key_pass; -
trunk/wp-includes/class-smtp.php
r8801 r11341 3 3 .---------------------------------------------------------------------------. 4 4 | Software: PHPMailer - PHP email class | 5 | Version: 2.0. 2|5 | Version: 2.0.4 | 6 6 | Contact: via sourceforge.net support pages (also www.codeworxtech.com) | 7 7 | Info: http://phpmailer.sourceforge.net |
Note: See TracChangeset
for help on using the changeset viewer.