diff --git app/code/core/Mage/Catalog/Model/Product.php app/code/core/Mage/Catalog/Model/Product.php index 3d538e2..7dcf307 100644 --- app/code/core/Mage/Catalog/Model/Product.php +++ app/code/core/Mage/Catalog/Model/Product.php @@ -1940,7 +1940,12 @@ class Mage_Catalog_Model_Product extends Mage_Catalog_Model_Abstract /* add product custom options data */ $customOptions = $buyRequest->getOptions(); if (is_array($customOptions)) { - $options->setOptions(array_diff($buyRequest->getOptions(), array(''))); + foreach ($customOptions as $key => $value) { + if ($value === '') { + unset($customOptions[$key]); + } + } + $options->setOptions($customOptions); } /* add product type selected options data */ diff --git app/code/core/Mage/Core/Controller/Varien/Router/Standard.php app/code/core/Mage/Core/Controller/Varien/Router/Standard.php index b2ebd4a..4500b24 100644 --- app/code/core/Mage/Core/Controller/Varien/Router/Standard.php +++ app/code/core/Mage/Core/Controller/Varien/Router/Standard.php @@ -43,7 +43,7 @@ class Mage_Core_Controller_Varien_Router_Standard extends Mage_Core_Controller_V $modules = array((string)$routerConfig->args->module); if ($routerConfig->args->modules) { foreach ($routerConfig->args->modules->children() as $customModule) { - if ($customModule) { + if ((string)$customModule) { if ($before = $customModule->getAttribute('before')) { $position = array_search($before, $modules); if ($position === false) { diff --git app/code/core/Zend/Pdf/FileParserDataSource.php app/code/core/Zend/Pdf/FileParserDataSource.php new file mode 100644 index 0000000..df5b2c7 --- /dev/null +++ app/code/core/Zend/Pdf/FileParserDataSource.php @@ -0,0 +1,189 @@ +_offset. + * + * Throws an exception if there is insufficient data to completely fulfill + * the request or if an error occurs. + * + * @param integer $byteCount Number of bytes to read. + * @return string + * @throws Zend_Pdf_Exception + */ + abstract public function readBytes($byteCount); + + /** + * Returns the entire contents of the data source as a string. + * + * This method may be called at any time and so must preserve the byte + * offset of the read position, both through $this->_offset and whatever + * other additional pointers (such as the seek position of a file pointer) + * that might be used. + * + * @return string + */ + abstract public function readAllBytes(); + + + /* Object Magic Methods */ + + /** + * Returns a description of the object for debugging purposes. + * + * Subclasses should override this method to provide a more specific + * description of the actual object being represented. + * + * @return string + */ + public function __toString() + { + return get_class($this); + } + + + /* Accessors */ + + /** + * Returns the byte offset of the current read position within the data + * source. + * + * @return integer + */ + public function getOffset() + { + return $this->_offset; + } + + /** + * Returns the total size in bytes of the data source. + * + * @return integer + */ + public function getSize() + { + return $this->_size; + } + + + /* Primitive Methods */ + + /** + * Moves the current read position to the specified byte offset. + * + * Throws an exception you attempt to move before the beginning or beyond + * the end of the data source. + * + * If a subclass needs to perform additional tasks (such as performing a + * fseek() on a filesystem source), it should do so after calling this + * parent method. + * + * @param integer $offset Destination byte offset. + * @throws Zend_Pdf_Exception + */ + public function moveToOffset($offset) + { + if ($this->_offset == $offset) { + return; // Not moving; do nothing. + } + if ($offset < 0) { + #require_once 'Zend/Pdf/Exception.php'; + throw new Zend_Pdf_Exception('Attempt to move before start of data source', + Zend_Pdf_Exception::MOVE_BEFORE_START_OF_FILE); + } + if ($offset >= $this->_size) { // Offsets are zero-based. + #require_once 'Zend/Pdf/Exception.php'; + throw new Zend_Pdf_Exception('Attempt to move beyond end of data source', + Zend_Pdf_Exception::MOVE_BEYOND_END_OF_FILE); + } + $this->_offset = $offset; + } + + /** + * Shifts the current read position within the data source by the specified + * number of bytes. + * + * You may move forward (positive numbers) or backward (negative numbers). + * Throws an exception you attempt to move before the beginning or beyond + * the end of the data source. + * + * @param integer $byteCount Number of bytes to skip. + * @throws Zend_Pdf_Exception + */ + public function skipBytes($byteCount) + { + $this->moveToOffset($this->_offset + $byteCount); + } +}