Magento Project Mess Detector: Code Pool Override Report

localcommunitycorelib
local1 / 0 / 0 / 0
community
core5 / 0 / 0 / 0
lib

Comparing local and core

Changed files (differentFileContent)

FileDiff
/Mage/Media/Model/File/Image.php
--- /project/app/code/local/Mage/Media/Model/File/Image.php	2015-12-18 18:10:56.000000000 +0000
+++ /project/app/code/core/Mage/Media/Model/File/Image.php	2015-12-18 18:06:44.000000000 +0000
@@ -10,17 +10,17 @@
  * http://opensource.org/licenses/osl-3.0.php
  * If you did not receive a copy of the license and are unable to
  * obtain it through the world-wide-web, please send an email
- * to license@magentocommerce.com so we can send you a copy immediately.
+ * to license@magento.com so we can send you a copy immediately.
  *
  * DISCLAIMER
  *
  * Do not edit or add to this file if you wish to upgrade Magento to newer
  * versions in the future. If you wish to customize Magento for your
- * needs please refer to http://www.magentocommerce.com for more information.
+ * needs please refer to http://www.magento.com for more information.
  *
  * @category    Mage
  * @package     Mage_Media
- * @copyright   Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
+ * @copyright  Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
  * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
  */
 
@@ -171,7 +171,7 @@
         switch (strtolower($extension)) {
             case 'jpg':
             case 'jpeg':
-                $result = imagejpeg($object->getTmpImage(), $object->getFilePath(true), 100);
+                $result = imagejpeg($object->getTmpImage(), $object->getFilePath(true), 80);
                 break;
             case 'gif':
                 $result = imagegif($object->getTmpImage(), $object->getFilePath(true));

Comparing core and lib

Changed files (differentFileContent)

FileDiff
/Mage/Backup/Exception.php
--- /project/app/code/core/Mage/Backup/Exception.php	2015-12-18 18:01:12.000000000 +0000
+++ /project/lib//Mage/Backup/Exception.php	2015-12-18 18:15:02.000000000 +0000
@@ -24,6 +24,13 @@
  * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
  */
 
-
-class Mage_Backup_Exception extends Zend_Exception
-{}
+/**
+ * Exception
+ *
+ * @category    Mage
+ * @package     Mage_Backup
+ * @author      Magento Core Team <core@magentocommerce.com>
+ */
+class Mage_Backup_Exception extends Mage_Exception
+{
+}
/Zend/Date.php
--- /project/app/code/core/Zend/Date.php	2015-12-18 17:54:12.000000000 +0000
+++ /project/lib//Zend/Date.php	2015-12-18 18:12:24.000000000 +0000
@@ -28,9 +28,6 @@
 #require_once 'Zend/Locale/Math.php';
 
 /**
- * This class replaces default Zend_Date because of problem described in Jira ticket MAGE-4872
- * The only difference between current class and original one is overwritten implementation of mktime method
- *
  * @category  Zend
  * @package   Zend_Date
  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
@@ -124,16 +121,6 @@
     const W3C               = 'WWW';
 
     /**
-     * Minimum allowed year value
-     */
-    const YEAR_MIN_VALUE = -10000;
-
-    /**
-     * Maximum allowed year value
-     */
-    const YEAR_MAX_VALUE = 10000;
-
-    /**
      * Generates the standard date object, could be a unix timestamp, localized date,
      * string, integer, array and so on. Also parts of dates or time are supported
      * Always set the default timezone: http://php.net/date_default_timezone_set
@@ -2084,6 +2071,14 @@
                 if (empty($timematch)) {
                     preg_match('/[T,\s]{0,1}(\d{2})(\d{2})(\d{2})/', $tmpdate, $timematch);
                 }
+                // (T)hh:mm
+                if (empty($timematch)) {
+                    preg_match('/[T,\s]{0,1}(\d{2}):(\d{2})/', $tmpdate, $timematch);
+                }
+                // (T)hhmm
+                if (empty($timematch)) {
+                    preg_match('/[T,\s]{0,1}(\d{2})(\d{2})/', $tmpdate, $timematch);
+                }
                 if (empty($datematch) and empty($timematch)) {
                     #require_once 'Zend/Date/Exception.php';
                     throw new Zend_Date_Exception("unsupported ISO8601 format ($date)", 0, null, $date);
@@ -4980,45 +4975,4 @@
 
         return $token;
     }
-
-    /**
-     * Get unix timestamp.
-     * Added limitation: $year value must be between -10 000 and 10 000
-     * Parent method implementation causes 504 error if it gets too big(small) year value
-     *
-     * @see Zend_Date_DateObject::mktime
-     * @throws Zend_Date_Exception
-     * @param $hour
-     * @param $minute
-     * @param $second
-     * @param $month
-     * @param $day
-     * @param $year
-     * @param bool $gmt
-     * @return float|int
-     */
-    protected function mktime($hour, $minute, $second, $month, $day, $year, $gmt = false)
-    {
-        $day   = intval($day);
-        $month = intval($month);
-        $year  = intval($year);
-
-        // correct months > 12 and months < 1
-        if ($month > 12) {
-            $overlap = floor($month / 12);
-            $year   += $overlap;
-            $month  -= $overlap * 12;
-        } else {
-            $overlap = ceil((1 - $month) / 12);
-            $year   -= $overlap;
-            $month  += $overlap * 12;
-        }
-
-        if ($year > self::YEAR_MAX_VALUE || $year < self::YEAR_MIN_VALUE) {
-            throw new Zend_Date_Exception('Invalid year, it must be between ' . self::YEAR_MIN_VALUE . ' and '
-                . self::YEAR_MAX_VALUE);
-        }
-
-        return parent::mktime($hour, $minute, $second, $month, $day, $year, $gmt);
-    }
 }
/Zend/Db/Select.php
--- /project/app/code/core/Zend/Db/Select.php	2015-12-18 17:54:12.000000000 +0000
+++ /project/lib//Zend/Db/Select.php	2015-12-18 18:13:16.000000000 +0000
@@ -157,20 +155,6 @@
      */
     protected $_tableCols = array();
 
-
-    /**
-     * List of MySql specific control characters
-     *
-     * @var array
-     */
-    protected $_controlCharacters = array(
-        ';',
-        '--',
-        '#',
-        '/*',
-        '*/',
-    );
-
     /**
      * Class constructor
      *
@@ -525,9 +509,7 @@
         }
 
         foreach ($spec as $val) {
-            if (preg_match('/\(.*\)/', (string) $val)
-                && !$this->isContainControlCharacters((string) $val)
-            ) {
+            if (preg_match('/^([\w]*\(([^\)]|(?1))*\))$/', (string) $val)) {
                 $val = new Zend_Db_Expr($val);
             }
             $this->_parts[self::GROUP][] = $val;
@@ -537,22 +519,6 @@
     }
 
     /**
-     * Check is expression contains some MySql control characters
-     *
-     * @param string $expression
-     * @return bool
-     */
-    public function isContainControlCharacters($expression) {
-        foreach ($this->_controlCharacters as $controlChar) {
-            if (strpos($expression, $controlChar) !== false) {
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    /**
      * Adds a HAVING condition to the query by AND.
      *
      * If a value is passed as the second param, it will be quoted
@@ -635,9 +601,7 @@
                     $val = trim($matches[1]);
                     $direction = $matches[2];
                 }
-                if (preg_match('/\(.*\)/', (string) $val)
-                    && !$this->isContainControlCharacters((string) $val)
-                ) {
+                if (preg_match('/^([\w]*\(([^\)]|(?1))*\))$/', (string) $val)) {
                     $val = new Zend_Db_Expr($val);
                 }
                 $this->_parts[self::ORDER][] = array($val, $direction);
@@ -841,9 +805,7 @@
                  * @see Zend_Db_Select_Exception
                  */
                 #require_once 'Zend/Db/Select/Exception.php';
-                throw new Zend_Db_Select_Exception(
-                    "You cannot define a correlation name '$correlationName' more than once"
-                );
+                throw new Zend_Db_Select_Exception("You cannot define a correlation name '$correlationName' more than once");
             }
 
             if ($type == self::FROM) {
@@ -981,9 +943,7 @@
                     $alias = $m[2];
                 }
                 // Check for columns that look like functions and convert to Zend_Db_Expr
-                if (preg_match('/\(.*\)/', (string) $col)
-                    && !$this->isContainControlCharacters((string) $col)
-                ) {
+                if (preg_match('/^([\w]*\(([^\)]|(?1))*\))$/', (string) $col)) {
                     $col = new Zend_Db_Expr($col);
                 } elseif (preg_match('/(.+)\.(.+)/', $col, $m)) {
                     $currentCorrelationName = $m[1];
/Zend/Db/Statement.php
--- /project/app/code/core/Zend/Db/Statement.php	2015-12-18 17:54:12.000000000 +0000
+++ /project/lib//Zend/Db/Statement.php	2015-12-18 18:13:16.000000000 +0000
@@ -15,9 +15,9 @@
  * @category   Zend
  * @package    Zend_Db
  * @subpackage Statement
- * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id: Statement.php 20096 2010-01-06 02:05:09Z bkarwin $
+ * @version    $Id$
  */
 
 /**
@@ -36,7 +36,7 @@
  * @category   Zend
  * @package    Zend_Db
  * @subpackage Statement
- * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 abstract class Zend_Db_Statement implements Zend_Db_Statement_Interface
@@ -176,28 +176,40 @@
      */
     protected function _stripQuoted($sql)
     {
-        // get the character for delimited id quotes,
-        // this is usually " but in MySQL is `
-        $d = $this->_adapter->quoteIdentifier('a');
-        $d = $d[0];
 
         // get the character for value quoting
         // this should be '
         $q = $this->_adapter->quote('a');
         $q = $q[0];
+        // get the value used as an escaped quote,
+        // e.g. \' or ''
+        $qe = $this->_adapter->quote($q);
+        $qe = substr($qe, 1, 2);
+        $qe = preg_quote($qe);
+        $escapeChar = substr($qe,0,1);
+        // remove 'foo\'bar'
+        if (!empty($q)) {
+            $escapeChar = preg_quote($escapeChar);
+            // this segfaults only after 65,000 characters instead of 9,000
+            $sql = preg_replace("/$q([^$q{$escapeChar}]*|($qe)*)*$q/s", '', $sql);
+        }
 
         // get a version of the SQL statement with all quoted
         // values and delimited identifiers stripped out
-        // remove quoted identifiers
-        if (!empty($d)) {
-            $rx = "{$d}.*?(?<!(((?<![{$d}\\\\]){$d})|((?<!\\\\)\\\\))){$d}(?!{$d})";
-            $sql = preg_replace("/$rx/Us", '', $sql);
-        }
-        // remove quoted values
-        if (!empty($q)) {
-            $rx = "{$q}.*?(?<!(((?<![{$q}\\\\]){$q})|((?<!\\\\)\\\\))){$q}(?!{$q})";
-            $sql = preg_replace("/$rx/Us", '', $sql);
-        }
+        // remove "foo\"bar"
+        $sql = preg_replace("/\"(\\\\\"|[^\"])*\"/Us", '', $sql);
+
+        // get the character for delimited id quotes,
+        // this is usually " but in MySQL is `
+        $d = $this->_adapter->quoteIdentifier('a');
+        $d = $d[0];
+        // get the value used as an escaped delimited id quote,
+        // e.g. \" or "" or \`
+        $de = $this->_adapter->quoteIdentifier($d);
+        $de = substr($de, 1, 2);
+        $de = preg_quote($de);
+        // Note: $de and $d where never used..., now they are:
+        $sql = preg_replace("/$d($de|\\\\{2}|[^$d])*$d/Us", '', $sql);
         return $sql;
     }
 
/Zend/Mime.php
--- /project/app/code/core/Zend/Mime.php	2015-12-18 17:54:12.000000000 +0000
+++ /project/lib//Zend/Mime.php	2015-12-18 18:12:24.000000000 +0000
@@ -14,12 +14,11 @@
  *
  * @category   Zend
  * @package    Zend_Mime
- * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
- * @version    $Id: Mime.php 16541 2009-07-07 06:59:03Z bkarwin $
+ * @version    $Id$
  */
 
-
 /**
  * Support class for MultiPart Mime Messages
  *
@@ -25,7 +24,7 @@
  *
  * @category   Zend
  * @package    Zend_Mime
- * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Mime
@@ -39,64 +38,363 @@
     const ENCODING_BASE64 = 'base64';
     const DISPOSITION_ATTACHMENT = 'attachment';
     const DISPOSITION_INLINE = 'inline';
-    const LINELENGTH = 200;
+    const LINELENGTH               = 72;
     const LINEEND = "\n";
     const MULTIPART_ALTERNATIVE = 'multipart/alternative';
     const MULTIPART_MIXED = 'multipart/mixed';
     const MULTIPART_RELATED = 'multipart/related';
 
+    /**
+     * Boundary
+     *
+     * @var null|string
+     */
     protected $_boundary;
+
+    /**
+     * @var int
+     */
     protected static $makeUnique = 0;
 
-    // lookup-Tables for QuotedPrintable
+    /**
+     * Lookup-Tables for QuotedPrintable
+     *
+     * @var array
+     */
     public static $qpKeys = array(
-        "\x00","\x01","\x02","\x03","\x04","\x05","\x06","\x07",
-        "\x08","\x09","\x0A","\x0B","\x0C","\x0D","\x0E","\x0F",
-        "\x10","\x11","\x12","\x13","\x14","\x15","\x16","\x17",
-        "\x18","\x19","\x1A","\x1B","\x1C","\x1D","\x1E","\x1F",
-        "\x7F","\x80","\x81","\x82","\x83","\x84","\x85","\x86",
-        "\x87","\x88","\x89","\x8A","\x8B","\x8C","\x8D","\x8E",
-        "\x8F","\x90","\x91","\x92","\x93","\x94","\x95","\x96",
-        "\x97","\x98","\x99","\x9A","\x9B","\x9C","\x9D","\x9E",
-        "\x9F","\xA0","\xA1","\xA2","\xA3","\xA4","\xA5","\xA6",
-        "\xA7","\xA8","\xA9","\xAA","\xAB","\xAC","\xAD","\xAE",
-        "\xAF","\xB0","\xB1","\xB2","\xB3","\xB4","\xB5","\xB6",
-        "\xB7","\xB8","\xB9","\xBA","\xBB","\xBC","\xBD","\xBE",
-        "\xBF","\xC0","\xC1","\xC2","\xC3","\xC4","\xC5","\xC6",
-        "\xC7","\xC8","\xC9","\xCA","\xCB","\xCC","\xCD","\xCE",
-        "\xCF","\xD0","\xD1","\xD2","\xD3","\xD4","\xD5","\xD6",
-        "\xD7","\xD8","\xD9","\xDA","\xDB","\xDC","\xDD","\xDE",
-        "\xDF","\xE0","\xE1","\xE2","\xE3","\xE4","\xE5","\xE6",
-        "\xE7","\xE8","\xE9","\xEA","\xEB","\xEC","\xED","\xEE",
-        "\xEF","\xF0","\xF1","\xF2","\xF3","\xF4","\xF5","\xF6",
-        "\xF7","\xF8","\xF9","\xFA","\xFB","\xFC","\xFD","\xFE",
+        "\x00",
+        "\x01",
+        "\x02",
+        "\x03",
+        "\x04",
+        "\x05",
+        "\x06",
+        "\x07",
+        "\x08",
+        "\x09",
+        "\x0A",
+        "\x0B",
+        "\x0C",
+        "\x0D",
+        "\x0E",
+        "\x0F",
+        "\x10",
+        "\x11",
+        "\x12",
+        "\x13",
+        "\x14",
+        "\x15",
+        "\x16",
+        "\x17",
+        "\x18",
+        "\x19",
+        "\x1A",
+        "\x1B",
+        "\x1C",
+        "\x1D",
+        "\x1E",
+        "\x1F",
+        "\x7F",
+        "\x80",
+        "\x81",
+        "\x82",
+        "\x83",
+        "\x84",
+        "\x85",
+        "\x86",
+        "\x87",
+        "\x88",
+        "\x89",
+        "\x8A",
+        "\x8B",
+        "\x8C",
+        "\x8D",
+        "\x8E",
+        "\x8F",
+        "\x90",
+        "\x91",
+        "\x92",
+        "\x93",
+        "\x94",
+        "\x95",
+        "\x96",
+        "\x97",
+        "\x98",
+        "\x99",
+        "\x9A",
+        "\x9B",
+        "\x9C",
+        "\x9D",
+        "\x9E",
+        "\x9F",
+        "\xA0",
+        "\xA1",
+        "\xA2",
+        "\xA3",
+        "\xA4",
+        "\xA5",
+        "\xA6",
+        "\xA7",
+        "\xA8",
+        "\xA9",
+        "\xAA",
+        "\xAB",
+        "\xAC",
+        "\xAD",
+        "\xAE",
+        "\xAF",
+        "\xB0",
+        "\xB1",
+        "\xB2",
+        "\xB3",
+        "\xB4",
+        "\xB5",
+        "\xB6",
+        "\xB7",
+        "\xB8",
+        "\xB9",
+        "\xBA",
+        "\xBB",
+        "\xBC",
+        "\xBD",
+        "\xBE",
+        "\xBF",
+        "\xC0",
+        "\xC1",
+        "\xC2",
+        "\xC3",
+        "\xC4",
+        "\xC5",
+        "\xC6",
+        "\xC7",
+        "\xC8",
+        "\xC9",
+        "\xCA",
+        "\xCB",
+        "\xCC",
+        "\xCD",
+        "\xCE",
+        "\xCF",
+        "\xD0",
+        "\xD1",
+        "\xD2",
+        "\xD3",
+        "\xD4",
+        "\xD5",
+        "\xD6",
+        "\xD7",
+        "\xD8",
+        "\xD9",
+        "\xDA",
+        "\xDB",
+        "\xDC",
+        "\xDD",
+        "\xDE",
+        "\xDF",
+        "\xE0",
+        "\xE1",
+        "\xE2",
+        "\xE3",
+        "\xE4",
+        "\xE5",
+        "\xE6",
+        "\xE7",
+        "\xE8",
+        "\xE9",
+        "\xEA",
+        "\xEB",
+        "\xEC",
+        "\xED",
+        "\xEE",
+        "\xEF",
+        "\xF0",
+        "\xF1",
+        "\xF2",
+        "\xF3",
+        "\xF4",
+        "\xF5",
+        "\xF6",
+        "\xF7",
+        "\xF8",
+        "\xF9",
+        "\xFA",
+        "\xFB",
+        "\xFC",
+        "\xFD",
+        "\xFE",
         "\xFF"
         );
 
+    /**
+     * @var array
+     */
     public static $qpReplaceValues = array(
-        "=00","=01","=02","=03","=04","=05","=06","=07",
-        "=08","=09","=0A","=0B","=0C","=0D","=0E","=0F",
-        "=10","=11","=12","=13","=14","=15","=16","=17",
-        "=18","=19","=1A","=1B","=1C","=1D","=1E","=1F",
-        "=7F","=80","=81","=82","=83","=84","=85","=86",
-        "=87","=88","=89","=8A","=8B","=8C","=8D","=8E",
-        "=8F","=90","=91","=92","=93","=94","=95","=96",
-        "=97","=98","=99","=9A","=9B","=9C","=9D","=9E",
-        "=9F","=A0","=A1","=A2","=A3","=A4","=A5","=A6",
-        "=A7","=A8","=A9","=AA","=AB","=AC","=AD","=AE",
-        "=AF","=B0","=B1","=B2","=B3","=B4","=B5","=B6",
-        "=B7","=B8","=B9","=BA","=BB","=BC","=BD","=BE",
-        "=BF","=C0","=C1","=C2","=C3","=C4","=C5","=C6",
-        "=C7","=C8","=C9","=CA","=CB","=CC","=CD","=CE",
-        "=CF","=D0","=D1","=D2","=D3","=D4","=D5","=D6",
-        "=D7","=D8","=D9","=DA","=DB","=DC","=DD","=DE",
-        "=DF","=E0","=E1","=E2","=E3","=E4","=E5","=E6",
-        "=E7","=E8","=E9","=EA","=EB","=EC","=ED","=EE",
-        "=EF","=F0","=F1","=F2","=F3","=F4","=F5","=F6",
-        "=F7","=F8","=F9","=FA","=FB","=FC","=FD","=FE",
+        "=00",
+        "=01",
+        "=02",
+        "=03",
+        "=04",
+        "=05",
+        "=06",
+        "=07",
+        "=08",
+        "=09",
+        "=0A",
+        "=0B",
+        "=0C",
+        "=0D",
+        "=0E",
+        "=0F",
+        "=10",
+        "=11",
+        "=12",
+        "=13",
+        "=14",
+        "=15",
+        "=16",
+        "=17",
+        "=18",
+        "=19",
+        "=1A",
+        "=1B",
+        "=1C",
+        "=1D",
+        "=1E",
+        "=1F",
+        "=7F",
+        "=80",
+        "=81",
+        "=82",
+        "=83",
+        "=84",
+        "=85",
+        "=86",
+        "=87",
+        "=88",
+        "=89",
+        "=8A",
+        "=8B",
+        "=8C",
+        "=8D",
+        "=8E",
+        "=8F",
+        "=90",
+        "=91",
+        "=92",
+        "=93",
+        "=94",
+        "=95",
+        "=96",
+        "=97",
+        "=98",
+        "=99",
+        "=9A",
+        "=9B",
+        "=9C",
+        "=9D",
+        "=9E",
+        "=9F",
+        "=A0",
+        "=A1",
+        "=A2",
+        "=A3",
+        "=A4",
+        "=A5",
+        "=A6",
+        "=A7",
+        "=A8",
+        "=A9",
+        "=AA",
+        "=AB",
+        "=AC",
+        "=AD",
+        "=AE",
+        "=AF",
+        "=B0",
+        "=B1",
+        "=B2",
+        "=B3",
+        "=B4",
+        "=B5",
+        "=B6",
+        "=B7",
+        "=B8",
+        "=B9",
+        "=BA",
+        "=BB",
+        "=BC",
+        "=BD",
+        "=BE",
+        "=BF",
+        "=C0",
+        "=C1",
+        "=C2",
+        "=C3",
+        "=C4",
+        "=C5",
+        "=C6",
+        "=C7",
+        "=C8",
+        "=C9",
+        "=CA",
+        "=CB",
+        "=CC",
+        "=CD",
+        "=CE",
+        "=CF",
+        "=D0",
+        "=D1",
+        "=D2",
+        "=D3",
+        "=D4",
+        "=D5",
+        "=D6",
+        "=D7",
+        "=D8",
+        "=D9",
+        "=DA",
+        "=DB",
+        "=DC",
+        "=DD",
+        "=DE",
+        "=DF",
+        "=E0",
+        "=E1",
+        "=E2",
+        "=E3",
+        "=E4",
+        "=E5",
+        "=E6",
+        "=E7",
+        "=E8",
+        "=E9",
+        "=EA",
+        "=EB",
+        "=EC",
+        "=ED",
+        "=EE",
+        "=EF",
+        "=F0",
+        "=F1",
+        "=F2",
+        "=F3",
+        "=F4",
+        "=F5",
+        "=F6",
+        "=F7",
+        "=F8",
+        "=F9",
+        "=FA",
+        "=FB",
+        "=FC",
+        "=FD",
+        "=FE",
         "=FF"
         );
 
+    /**
+     * @var string
+     */
     public static $qpKeysString =
          "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF";
 
@@ -118,13 +416,15 @@
      * Encode a given string with the QUOTED_PRINTABLE mechanism and wrap the lines.
      *
      * @param string $str
-     * @param int $lineLength Defaults to {@link LINELENGTH}
-     * @param int $lineEnd Defaults to {@link LINEEND}
+     * @param  int    $lineLength Line length; defaults to {@link LINELENGTH}
+     * @param  string $lineEnd    Line end; defaults to {@link LINEEND}
      * @return string
      */
-    public static function encodeQuotedPrintable($str,
+    public static function encodeQuotedPrintable(
+        $str,
         $lineLength = self::LINELENGTH,
-        $lineEnd = self::LINEEND)
+        $lineEnd = self::LINEEND
+    )
     {
         $out = '';
         $str = self::_encodeQuotedPrintable($str);
@@ -179,13 +481,13 @@
      *
      * @param string $str
      * @param string $charset
-     * @param int $lineLength Defaults to {@link LINELENGTH}
-     * @param int $lineEnd Defaults to {@link LINEEND}
+     * @param  int    $lineLength Line length; defaults to {@link LINELENGTH}
+     * @param  string $lineEnd    Line end; defaults to {@link LINEEND}
      * @return string
      */
-    public static function encodeQuotedPrintableHeader($str, $charset,
-        $lineLength = self::LINELENGTH,
-        $lineEnd = self::LINEEND)
+    public static function encodeQuotedPrintableHeader(
+        $str, $charset, $lineLength = self::LINELENGTH, $lineEnd = self::LINEEND
+    )
     {
         // Reduce line-length by the length of the required delimiter, charsets and encoding
         $prefix = sprintf('=?%s?Q?', $charset);
@@ -194,7 +496,9 @@
         $str = self::_encodeQuotedPrintable($str);
 
         // Mail-Header required chars have to be encoded also:
-        $str = str_replace(array('?', ' ', '_'), array('=3F', '=20', '=5F'), $str);
+        $str = str_replace(
+            array('?', ' ', '_', ','), array('=3F', '=20', '=5F', '=2C'), $str
+        );
 
         // initialize first line, we need it anyways
         $lines = array(0 => "");
@@ -252,22 +558,24 @@
      *
      * @param string $str
      * @param string $charset
-     * @param int $lineLength Defaults to {@link LINELENGTH}
-     * @param int $lineEnd Defaults to {@link LINEEND}
+     * @param  int    $lineLength Line length; defaults to {@link LINELENGTH}
+     * @param  string $lineEnd    Line end; defaults to {@link LINEEND}
      * @return string
      */
-    public static function encodeBase64Header($str,
-        $charset,
-        $lineLength = self::LINELENGTH,
-        $lineEnd = self::LINEEND)
+    public static function encodeBase64Header(
+        $str, $charset, $lineLength = self::LINELENGTH, $lineEnd = self::LINEEND
+    )
     {
         $prefix = '=?' . $charset . '?B?';
         $suffix = '?=';
         $remainingLength = $lineLength - strlen($prefix) - strlen($suffix);
 
         $encodedValue = self::encodeBase64($str, $remainingLength, $lineEnd);
-        $encodedValue = str_replace($lineEnd, $suffix . $lineEnd . ' ' . $prefix, $encodedValue);
+        $encodedValue = str_replace(
+            $lineEnd, $suffix . $lineEnd . ' ' . $prefix, $encodedValue
+        );
         $encodedValue = $prefix . $encodedValue . $suffix;
+
         return $encodedValue;
     }
 
@@ -276,13 +584,13 @@
      * according to the maximum linelength.
      *
      * @param string $str
-     * @param int $lineLength Defaults to {@link LINELENGTH}
-     * @param int $lineEnd Defaults to {@link LINEEND}
+     * @param  int    $lineLength Line length; defaults to {@link LINELENGTH}
+     * @param  string $lineEnd    Line end; defaults to {@link LINEEND}
      * @return string
      */
-    public static function encodeBase64($str,
-        $lineLength = self::LINELENGTH,
-        $lineEnd = self::LINEEND)
+    public static function encodeBase64(
+        $str, $lineLength = self::LINELENGTH, $lineEnd = self::LINEEND
+    )
     {
         return rtrim(chunk_split(base64_encode($str), $lineLength, $lineEnd));
     }
@@ -291,8 +599,6 @@
      * Constructor
      *
      * @param null|string $boundary
-     * @access public
-     * @return void
      */
     public function __construct($boundary = null)
     {
@@ -309,7 +615,7 @@
      *
      * @param string $str
      * @param string $encoding
-     * @param string $EOL EOL string; defaults to {@link Zend_Mime::LINEEND}
+     * @param string $EOL Line end; defaults to {@link Zend_Mime::LINEEND}
      * @return string
      */
     public static function encode($str, $encoding, $EOL = self::LINEEND)
@@ -343,8 +649,7 @@
     /**
      * Return a MIME boundary line
      *
-     * @param mixed $EOL Defaults to {@link LINEEND}
-     * @access public
+     * @param  string $EOL Line end; defaults to {@link LINEEND}
      * @return string
      */
     public function boundaryLine($EOL = self::LINEEND)
@@ -355,7 +660,7 @@
     /**
      * Return MIME ending
      *
-     * @access public
+     * @param  string $EOL Line end; defaults to {@link LINEEND}
      * @return string
      */
     public function mimeEnd($EOL = self::LINEEND)