开发者

SQL Escaping/Sanitizing Magento Item Attribute Value Data That Is Set Programmatically?

开发者 https://www.devze.com 2023-03-20 15:53 出处:网络
When I programmatically set a Magento item attribute to data that the user provided, do I need to SQL escape/sanitize that data or does Magento take care开发者_运维技巧 of doing so?

When I programmatically set a Magento item attribute to data that the user provided, do I need to SQL escape/sanitize that data or does Magento take care开发者_运维技巧 of doing so?

-- Here's a code example:

$cart = Mage::getSingleton('checkout/cart');
$cart->addProduct($product, array('qty' => 1, 'options' => array(5 =>$rawDataFromPost)));
$cart->save();


Data is properly sanitized and quoted. In fact the Zend framework does that, which Magento is built on.

0

精彩评论

暂无评论...
验证码 换一张
取 消