diff --git a/app/code/core/Mage/Core/Model/Resource/Abstract.php b/app/code/core/Mage/Core/Model/Resource/Abstract.php index d3e5b917ccf..652f7ec45b8 100644 --- a/app/code/core/Mage/Core/Model/Resource/Abstract.php +++ b/app/code/core/Mage/Core/Model/Resource/Abstract.php @@ -230,9 +230,8 @@ protected function _prepareDataForTable(Varien_Object $object, $table) */ protected function _prepareTableValueForSave($value, $type) { - $type = strtolower($type); if ($type == 'decimal' || $type == 'numeric' || $type == 'float') { - $value = Mage::app()->getLocale()->getNumber($value); + return Mage::app()->getLocale()->getNumber($value); } return $value; } diff --git a/lib/Varien/Db/Adapter/Pdo/Mysql.php b/lib/Varien/Db/Adapter/Pdo/Mysql.php index 18e468321ed..ac068ea69af 100644 --- a/lib/Varien/Db/Adapter/Pdo/Mysql.php +++ b/lib/Varien/Db/Adapter/Pdo/Mysql.php @@ -3008,8 +3008,8 @@ public function prepareSqlCondition($fieldName, $condition) */ protected function _prepareQuotedSqlCondition($text, $value, $fieldName) { - $text = str_replace('{{fieldName}}', $fieldName, $text); - return $this->quoteInto($text, $value); + $sql = $this->quoteInto($text, str_replace("\0", '', $value)); + return str_replace('{{fieldName}}', $fieldName, $sql); } /** @@ -3023,7 +3023,7 @@ protected function _prepareQuotedSqlCondition($text, $value, $fieldName) */ protected function _transformStringSqlCondition($conditionKey, $value) { - $value = (string) $value; + $value = str_replace("\0", '', (string) $value); if ($value == '') { return ($conditionKey == 'seq') ? 'null' : 'notnull'; } else { @@ -3098,7 +3098,7 @@ public function prepareColumnValue(array $column, $value) case 'mediumtext': case 'text': case 'longtext': - $value = (string)$value; + $value = str_replace("\0", '', (string)$value); if ($column['NULLABLE'] && $value == '') { $value = null; }