Magento 1.9.4.1 + SUPEE 11155 diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/Mage.php b/app/Mage.php | |
index 89b63ed6..327e9286 100644 | |
--- a/app/Mage.php | |
+++ b/app/Mage.php | |
@@ -816,9 +816,9 @@ final class Mage | |
',', | |
(string) self::getConfig()->getNode('dev/log/allowedFileExtensions', Mage_Core_Model_Store::DEFAULT_CODE) | |
); | |
- $logValidator = new Zend_Validate_File_Extension($_allowedFileExtensions); | |
$logDir = self::getBaseDir('var') . DS . 'log'; | |
- if (!$logValidator->isValid($logDir . DS . $file)) { | |
+ $validatedFileExtension = pathinfo($file, PATHINFO_EXTENSION); | |
+ if (!$validatedFileExtension || !in_array($validatedFileExtension, $_allowedFileExtensions)) { | |
return; | |
} | |
diff --git a/app/code/core/Mage/Admin/Model/Block.php b/app/code/core/Mage/Admin/Model/Block.php | |
index ba329cba..c2ad8edc 100644 | |
--- a/app/code/core/Mage/Admin/Model/Block.php | |
+++ b/app/code/core/Mage/Admin/Model/Block.php | |
@@ -57,7 +57,7 @@ class Mage_Admin_Model_Block extends Mage_Core_Model_Abstract | |
if (in_array($this->getBlockName(), $disallowedBlockNames)) { | |
$errors[] = Mage::helper('adminhtml')->__('Block Name is disallowed.'); | |
} | |
- if (!Zend_Validate::is($this->getBlockName(), 'Regex', array('/^[-_a-zA-Z0-9\/]*$/'))) { | |
+ if (!Zend_Validate::is($this->getBlockName(), 'Regex', array('/^[-_a-zA-Z0-9]+\/[-_a-zA-Z0-9\/]+$/'))) { | |
$errors[] = Mage::helper('adminhtml')->__('Block Name is incorrect.'); | |
} | |
diff --git a/app/code/core/Mage/Admin/Model/User.php b/app/code/core/Mage/Admin/Model/User.php | |
index eac448a7..c6511950 100644 | |
--- a/app/code/core/Mage/Admin/Model/User.php | |
+++ b/app/code/core/Mage/Admin/Model/User.php | |
@@ -590,7 +590,7 @@ class Mage_Admin_Model_User extends Mage_Core_Model_Abstract | |
} | |
if ($this->userExists()) { | |
- $errors[] = Mage::helper('adminhtml')->__('A user with the same user name or email aleady exists.'); | |
+ $errors[] = Mage::helper('adminhtml')->__('A user with the same user name or email already exists.'); | |
} | |
if (count($errors) === 0) { | |
diff --git a/app/code/core/Mage/AdminNotification/etc/system.xml b/app/code/core/Mage/AdminNotification/etc/system.xml | |
index cd9e2b6b..9e763d0c 100644 | |
--- a/app/code/core/Mage/AdminNotification/etc/system.xml | |
+++ b/app/code/core/Mage/AdminNotification/etc/system.xml | |
@@ -64,6 +64,15 @@ | |
<show_in_website>0</show_in_website> | |
<show_in_store>0</show_in_store> | |
</last_update> | |
+ <feed_url> | |
+ <label>Feed Url</label> | |
+ <frontend_type>text</frontend_type> | |
+ <backend_model>adminhtml/system_config_backend_protected</backend_model> | |
+ <sort_order>3</sort_order> | |
+ <show_in_default>0</show_in_default> | |
+ <show_in_website>0</show_in_website> | |
+ <show_in_store>0</show_in_store> | |
+ </feed_url> | |
</fields> | |
</adminnotification> | |
</groups> | |
diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Role/Grid/User.php b/app/code/core/Mage/Adminhtml/Block/Api/Role/Grid/User.php | |
index 7fa0f727..8c2fd659 100644 | |
--- a/app/code/core/Mage/Adminhtml/Block/Api/Role/Grid/User.php | |
+++ b/app/code/core/Mage/Adminhtml/Block/Api/Role/Grid/User.php | |
@@ -157,7 +157,7 @@ class Mage_Adminhtml_Block_Api_Role_Grid_User extends Mage_Adminhtml_Block_Widge | |
protected function _getUsers($json=false) | |
{ | |
if ( $this->getRequest()->getParam('in_role_user') != "" ) { | |
- return $this->getRequest()->getParam('in_role_user'); | |
+ return (int)$this->getRequest()->getParam('in_role_user'); | |
} | |
$roleId = ( $this->getRequest()->getParam('rid') > 0 ) ? $this->getRequest()->getParam('rid') : Mage::registry('RID'); | |
$users = Mage::getModel('api/roles')->setId($roleId)->getRoleUsers(); | |
diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config.php | |
index e1c2df94..1c9b3f1e 100644 | |
--- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config.php | |
+++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config.php | |
@@ -155,6 +155,8 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config extends Mage_Ad | |
// Hide price if needed | |
foreach ($attributes as &$attribute) { | |
$attribute['label'] = $this->escapeHtml($attribute['label']); | |
+ $attribute['frontend_label'] = $this->escapeHtml($attribute['frontend_label']); | |
+ $attribute['store_label'] = $this->escapeHtml($attribute['store_label']); | |
if (isset($attribute['values']) && is_array($attribute['values'])) { | |
foreach ($attribute['values'] as &$attributeValue) { | |
if (!$this->getCanReadPrice()) { | |
diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview.php | |
index ea78d541..ff437b30 100644 | |
--- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview.php | |
+++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview.php | |
@@ -50,6 +50,12 @@ class Mage_Adminhtml_Block_Newsletter_Queue_Preview extends Mage_Adminhtml_Block | |
$template->setTemplateText($this->getRequest()->getParam('text')); | |
$template->setTemplateStyles($this->getRequest()->getParam('styles')); | |
} | |
+ $template->setTemplateStyles( | |
+ $this->maliciousCodeFilter($template->getTemplateStyles()) | |
+ ); | |
+ $template->setTemplateText( | |
+ $this->maliciousCodeFilter($template->getTemplateText()) | |
+ ); | |
$storeId = (int)$this->getRequest()->getParam('store_id'); | |
if(!$storeId) { | |
diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview.php | |
index 2eeda67f..fb580619 100644 | |
--- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview.php | |
+++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview.php | |
@@ -46,6 +46,12 @@ class Mage_Adminhtml_Block_Newsletter_Template_Preview extends Mage_Adminhtml_Bl | |
$template->setTemplateText($this->getRequest()->getParam('text')); | |
$template->setTemplateStyles($this->getRequest()->getParam('styles')); | |
} | |
+ $template->setTemplateStyles( | |
+ $this->maliciousCodeFilter($template->getTemplateStyles()) | |
+ ); | |
+ $template->setTemplateText( | |
+ $this->maliciousCodeFilter($template->getTemplateText()) | |
+ ); | |
$storeId = (int)$this->getRequest()->getParam('store_id'); | |
if(!$storeId) { | |
diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Role/Grid/User.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Role/Grid/User.php | |
index 159773d3..3b0a668a 100644 | |
--- a/app/code/core/Mage/Adminhtml/Block/Permissions/Role/Grid/User.php | |
+++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Role/Grid/User.php | |
@@ -157,7 +157,7 @@ class Mage_Adminhtml_Block_Permissions_Role_Grid_User extends Mage_Adminhtml_Blo | |
protected function _getUsers($json=false) | |
{ | |
if ( $this->getRequest()->getParam('in_role_user') != "" ) { | |
- return $this->getRequest()->getParam('in_role_user'); | |
+ return (int)$this->getRequest()->getParam('in_role_user'); | |
} | |
$roleId = ( $this->getRequest()->getParam('rid') > 0 ) ? $this->getRequest()->getParam('rid') : Mage::registry('RID'); | |
$users = Mage::getModel('admin/roles')->setId($roleId)->getRoleUsers(); | |
diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo/Grid.php | |
index d81c515c..4c0001f2 100644 | |
--- a/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo/Grid.php | |
+++ b/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo/Grid.php | |
@@ -76,6 +76,7 @@ class Mage_Adminhtml_Block_Sales_Creditmemo_Grid extends Mage_Adminhtml_Block_Wi | |
'header' => Mage::helper('sales')->__('Order #'), | |
'index' => 'order_increment_id', | |
'type' => 'text', | |
+ 'escape' => true, | |
)); | |
$this->addColumn('order_created_at', array( | |
diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Invoice/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Invoice/Grid.php | |
index c8a6598c..59c38a1e 100644 | |
--- a/app/code/core/Mage/Adminhtml/Block/Sales/Invoice/Grid.php | |
+++ b/app/code/core/Mage/Adminhtml/Block/Sales/Invoice/Grid.php | |
@@ -77,6 +77,7 @@ class Mage_Adminhtml_Block_Sales_Invoice_Grid extends Mage_Adminhtml_Block_Widge | |
'header' => Mage::helper('sales')->__('Order #'), | |
'index' => 'order_increment_id', | |
'type' => 'text', | |
+ 'escape' => true, | |
)); | |
$this->addColumn('order_created_at', array( | |
diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Header.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Header.php | |
index 9b18cba2..169c8d61 100644 | |
--- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Header.php | |
+++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Header.php | |
@@ -34,7 +34,10 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Header extends Mage_Adminhtml_Bloc | |
protected function _toHtml() | |
{ | |
if ($this->_getSession()->getOrder()->getId()) { | |
- return '<h3 class="icon-head head-sales-order">'.Mage::helper('sales')->__('Edit Order #%s', $this->_getSession()->getOrder()->getIncrementId()).'</h3>'; | |
+ return '<h3 class="icon-head head-sales-order">' . Mage::helper('sales')->__( | |
+ 'Edit Order #%s', | |
+ $this->escapeHtml($this->_getSession()->getOrder()->getIncrementId()) | |
+ ) . '</h3>'; | |
} | |
$customerId = $this->getCustomerId(); | |
diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create.php | |
index e1e1c5b5..a7420552 100644 | |
--- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create.php | |
+++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create.php | |
@@ -67,10 +67,15 @@ class Mage_Adminhtml_Block_Sales_Order_Creditmemo_Create extends Mage_Adminhtml_ | |
public function getHeaderText() | |
{ | |
if ($this->getCreditmemo()->getInvoice()) { | |
- $header = Mage::helper('sales')->__('New Credit Memo for Invoice #%s', $this->getCreditmemo()->getInvoice()->getIncrementId()); | |
- } | |
- else { | |
- $header = Mage::helper('sales')->__('New Credit Memo for Order #%s', $this->getCreditmemo()->getOrder()->getRealOrderId()); | |
+ $header = Mage::helper('sales')->__( | |
+ 'New Credit Memo for Invoice #%s', | |
+ $this->escapeHtml($this->getCreditmemo()->getInvoice()->getIncrementId()) | |
+ ); | |
+ } else { | |
+ $header = Mage::helper('sales')->__( | |
+ 'New Credit Memo for Order #%s', | |
+ $this->escapeHtml($this->getCreditmemo()->getOrder()->getRealOrderId()) | |
+ ); | |
} | |
return $header; | |
diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php | |
index 43ba9cd9..97877477 100644 | |
--- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php | |
+++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php | |
@@ -65,10 +65,11 @@ class Mage_Adminhtml_Block_Sales_Order_Grid extends Mage_Adminhtml_Block_Widget_ | |
{ | |
$this->addColumn('real_order_id', array( | |
- 'header'=> Mage::helper('sales')->__('Order #'), | |
- 'width' => '80px', | |
- 'type' => 'text', | |
- 'index' => 'increment_id', | |
+ 'header' => Mage::helper('sales')->__('Order #'), | |
+ 'width' => '80px', | |
+ 'type' => 'text', | |
+ 'index' => 'increment_id', | |
+ 'escape' => true, | |
)); | |
if (!Mage::app()->isSingleStoreMode()) { | |
diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create.php | |
index b3a152d7..3528bebd 100644 | |
--- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create.php | |
+++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create.php | |
@@ -64,8 +64,14 @@ class Mage_Adminhtml_Block_Sales_Order_Invoice_Create extends Mage_Adminhtml_Blo | |
public function getHeaderText() | |
{ | |
return ($this->getInvoice()->getOrder()->getForcedDoShipmentWithInvoice()) | |
- ? Mage::helper('sales')->__('New Invoice and Shipment for Order #%s', $this->getInvoice()->getOrder()->getRealOrderId()) | |
- : Mage::helper('sales')->__('New Invoice for Order #%s', $this->getInvoice()->getOrder()->getRealOrderId()); | |
+ ? Mage::helper('sales')->__( | |
+ 'New Invoice and Shipment for Order #%s', | |
+ $this->escapeHtml($this->getInvoice()->getOrder()->getRealOrderId()) | |
+ ) | |
+ : Mage::helper('sales')->__( | |
+ 'New Invoice for Order #%s', | |
+ $this->escapeHtml($this->getInvoice()->getOrder()->getRealOrderId()) | |
+ ); | |
} | |
/** | |
diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create.php | |
index e39ee02e..21e581a8 100644 | |
--- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create.php | |
+++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create.php | |
@@ -59,7 +59,10 @@ class Mage_Adminhtml_Block_Sales_Order_Shipment_Create extends Mage_Adminhtml_Bl | |
public function getHeaderText() | |
{ | |
- $header = Mage::helper('sales')->__('New Shipment for Order #%s', $this->getShipment()->getOrder()->getRealOrderId()); | |
+ $header = Mage::helper('sales')->__( | |
+ 'New Shipment for Order #%s', | |
+ $this->escapeHtml($this->getShipment()->getOrder()->getRealOrderId()) | |
+ ); | |
return $header; | |
} | |
diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php | |
index 0af75c74..ea97b989 100644 | |
--- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php | |
+++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php | |
@@ -315,6 +315,16 @@ class Mage_Adminhtml_Block_Sales_Order_View extends Mage_Adminhtml_Block_Widget_ | |
{ | |
return $this->getUrl('*/*/reviewPayment', array('action' => $action)); | |
} | |
+ | |
+ /** | |
+ * Return header for view grid | |
+ * | |
+ * @return string | |
+ */ | |
+ public function getHeaderHtml() | |
+ { | |
+ return '<h3 class="' . $this->getHeaderCssClass() . '">' . $this->escapeHtml($this->getHeaderText()) . '</h3>'; | |
+ } | |
// | |
// /** | |
// * Return URL for accept payment action | |
diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Shipment/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Shipment/Grid.php | |
index 0676cb14..10324e57 100644 | |
--- a/app/code/core/Mage/Adminhtml/Block/Sales/Shipment/Grid.php | |
+++ b/app/code/core/Mage/Adminhtml/Block/Sales/Shipment/Grid.php | |
@@ -88,6 +88,7 @@ class Mage_Adminhtml_Block_Sales_Shipment_Grid extends Mage_Adminhtml_Block_Widg | |
'header' => Mage::helper('sales')->__('Order #'), | |
'index' => 'order_increment_id', | |
'type' => 'text', | |
+ 'escape' => true, | |
)); | |
$this->addColumn('order_created_at', array( | |
diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Grid.php | |
index cc107f68..5559512c 100644 | |
--- a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Grid.php | |
+++ b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Grid.php | |
@@ -82,7 +82,8 @@ class Mage_Adminhtml_Block_Sales_Transactions_Grid extends Mage_Adminhtml_Block_ | |
$this->addColumn('increment_id', array( | |
'header' => Mage::helper('sales')->__('Order ID'), | |
'index' => 'increment_id', | |
- 'type' => 'text' | |
+ 'type' => 'text', | |
+ 'escape' => true, | |
)); | |
$this->addColumn('txn_id', array( | |
diff --git a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Preview.php b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Preview.php | |
index 4b02ec03..03b732bf 100644 | |
--- a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Preview.php | |
+++ b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Preview.php | |
@@ -58,11 +58,12 @@ class Mage_Adminhtml_Block_System_Email_Template_Preview extends Mage_Adminhtml_ | |
$template->setTemplateStyles($this->getRequest()->getParam('styles')); | |
} | |
- /* @var $filter Mage_Core_Model_Input_Filter_MaliciousCode */ | |
- $filter = Mage::getSingleton('core/input_filter_maliciousCode'); | |
+ $template->setTemplateStyles( | |
+ $this->maliciousCodeFilter($template->getTemplateStyles()) | |
+ ); | |
$template->setTemplateText( | |
- $filter->filter($template->getTemplateText()) | |
+ $this->maliciousCodeFilter($template->getTemplateText()) | |
); | |
Varien_Profiler::start("email_template_proccessing"); | |
diff --git a/app/code/core/Mage/Adminhtml/Block/Template.php b/app/code/core/Mage/Adminhtml/Block/Template.php | |
index 08201f1a..5629a4b9 100644 | |
--- a/app/code/core/Mage/Adminhtml/Block/Template.php | |
+++ b/app/code/core/Mage/Adminhtml/Block/Template.php | |
@@ -80,4 +80,15 @@ class Mage_Adminhtml_Block_Template extends Mage_Core_Block_Template | |
Mage::dispatchEvent('adminhtml_block_html_before', array('block' => $this)); | |
return parent::_toHtml(); | |
} | |
+ | |
+ /** | |
+ * Deleting script tags from string | |
+ * | |
+ * @param string $html | |
+ * @return string | |
+ */ | |
+ public function maliciousCodeFilter($html) | |
+ { | |
+ return Mage::getSingleton('core/input_filter_maliciousCode')->filter($html); | |
+ } | |
} | |
diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php | |
index e884e05c..05ce8fdc 100644 | |
--- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php | |
+++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php | |
@@ -114,9 +114,9 @@ abstract class Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract | |
} | |
$out = '<a href="#" name="' . $this->getColumn()->getId() . '" title="' . $nDir | |
. '" class="' . $className . '"><span class="sort-title">' | |
- . $this->getColumn()->getHeader().'</span></a>'; | |
+ . $this->escapeHtml($this->getColumn()->getHeader()) . '</span></a>'; | |
} else { | |
- $out = $this->getColumn()->getHeader(); | |
+ $out = $this->escapeHtml($this->getColumn()->getHeader()); | |
} | |
return $out; | |
} | |
diff --git a/app/code/core/Mage/Adminhtml/Model/LayoutUpdate/Validator.php b/app/code/core/Mage/Adminhtml/Model/LayoutUpdate/Validator.php | |
index 513fc9c3..2a160e9d 100644 | |
--- a/app/code/core/Mage/Adminhtml/Model/LayoutUpdate/Validator.php | |
+++ b/app/code/core/Mage/Adminhtml/Model/LayoutUpdate/Validator.php | |
@@ -180,8 +180,11 @@ class Mage_Adminhtml_Model_LayoutUpdate_Validator extends Zend_Validate_Abstract | |
protected function _getXpathBlockValidationExpression() { | |
$xpath = ""; | |
if (count($this->_disallowedBlock)) { | |
- $xpath = "//block[@type='"; | |
- $xpath .= implode("'] | //block[@type='", $this->_disallowedBlock) . "']"; | |
+ foreach ($this->_disallowedBlock as $key => $value) { | |
+ $xpath .= $key > 0 ? " | " : ''; | |
+ $xpath .= "//block[translate(@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = "; | |
+ $xpath .= "translate('$value', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')]"; | |
+ } | |
} | |
return $xpath; | |
} | |
diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Baseurl.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Baseurl.php | |
index 55537c27..7247bf98 100644 | |
--- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Baseurl.php | |
+++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Baseurl.php | |
@@ -36,6 +36,8 @@ class Mage_Adminhtml_Model_System_Config_Backend_Baseurl extends Mage_Core_Model | |
$parsedUrl = parse_url($value); | |
if (!isset($parsedUrl['scheme']) || !isset($parsedUrl['host'])) { | |
Mage::throwException(Mage::helper('core')->__('The %s you entered is invalid. Please make sure that it follows "http://domain.com/" format.', $this->getFieldConfig()->label)); | |
+ } elseif (('https' != $parsedUrl['scheme']) && ('http' != $parsedUrl['scheme'])) { | |
+ Mage::throwException(Mage::helper('core')->__('Invalid URL scheme.')); | |
} | |
} | |
diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Locale.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Locale.php | |
index 9ec0be20..04dcfd81 100644 | |
--- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Locale.php | |
+++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Locale.php | |
@@ -34,6 +34,27 @@ | |
*/ | |
class Mage_Adminhtml_Model_System_Config_Backend_Locale extends Mage_Core_Model_Config_Data | |
{ | |
+ /** | |
+ * Validate data before save data | |
+ * | |
+ * @return Mage_Core_Model_Abstract | |
+ * @throws Mage_Core_Exception | |
+ */ | |
+ protected function _beforeSave() | |
+ { | |
+ $allCurrenciesOptions = Mage::getSingleton('adminhtml/system_config_source_locale_currency_all') | |
+ ->toOptionArray(true); | |
+ | |
+ $allCurrenciesValues = array_column($allCurrenciesOptions, 'value'); | |
+ | |
+ foreach ($this->getValue() as $currency) { | |
+ if (!in_array($currency, $allCurrenciesValues)) { | |
+ Mage::throwException(Mage::helper('adminhtml')->__('Currency doesn\'t exist.')); | |
+ } | |
+ } | |
+ | |
+ return parent::_beforeSave(); | |
+ } | |
/** | |
* Enter description here... | |
diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Serialized/Array.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Serialized/Array.php | |
index fef80ead..a4529e42 100644 | |
--- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Serialized/Array.php | |
+++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Serialized/Array.php | |
@@ -31,11 +31,19 @@ | |
class Mage_Adminhtml_Model_System_Config_Backend_Serialized_Array extends Mage_Adminhtml_Model_System_Config_Backend_Serialized | |
{ | |
/** | |
- * Unset array element with '__empty' key | |
+ * Check object existence in incoming data and unset array element with '__empty' key | |
* | |
+ * @throws Mage_Core_Exception | |
+ * @return void | |
*/ | |
protected function _beforeSave() | |
{ | |
+ try { | |
+ Mage::helper('core/unserializeArray')->unserialize(serialize($this->getValue())); | |
+ } catch (Exception $e) { | |
+ Mage::throwException(Mage::helper('adminhtml')->__('Serialized data is incorrect')); | |
+ } | |
+ | |
$value = $this->getValue(); | |
if (is_array($value)) { | |
unset($value['__empty']); | |
diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php | |
index 43cf415a..c390a873 100644 | |
--- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php | |
+++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php | |
@@ -172,6 +172,7 @@ class Mage_Adminhtml_Catalog_Product_AttributeController extends Mage_Adminhtml_ | |
/** @var $helperCatalog Mage_Catalog_Helper_Data */ | |
$helperCatalog = Mage::helper('catalog'); | |
//labels | |
+ $data['frontend_label'] = (array) $data['frontend_label']; | |
foreach ($data['frontend_label'] as & $value) { | |
if ($value) { | |
$value = $helperCatalog->stripTags($value); | |
diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/ReviewController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/ReviewController.php | |
index 4e5a97a4..1976d3ab 100644 | |
--- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/ReviewController.php | |
+++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/ReviewController.php | |
@@ -41,6 +41,17 @@ class Mage_Adminhtml_Catalog_Product_ReviewController extends Mage_Adminhtml_Con | |
*/ | |
protected $_publicActions = array('edit'); | |
+ /** | |
+ * Controller predispatch method | |
+ * | |
+ * @return Mage_Adminhtml_Controller_Action | |
+ */ | |
+ public function preDispatch() | |
+ { | |
+ $this->_setForcedFormKeyActions(array('delete', 'massDelete')); | |
+ return parent::preDispatch(); | |
+ } | |
+ | |
public function indexAction() | |
{ | |
$this->_title($this->__('Catalog')) | |
diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php | |
index a38dd91f..264f7f3d 100644 | |
--- a/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php | |
+++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php | |
@@ -550,7 +550,7 @@ class Mage_Adminhtml_Catalog_ProductController extends Mage_Adminhtml_Controller | |
catch (Mage_Eav_Model_Entity_Attribute_Exception $e) { | |
$response->setError(true); | |
$response->setAttribute($e->getAttributeCode()); | |
- $response->setMessage($e->getMessage()); | |
+ $response->setMessage(Mage::helper('core')->escapeHtml($e->getMessage())); | |
} catch (Mage_Core_Exception $e) { | |
$response->setError(true); | |
$response->setMessage($e->getMessage()); | |
diff --git a/app/code/core/Mage/Adminhtml/controllers/Checkout/AgreementController.php b/app/code/core/Mage/Adminhtml/controllers/Checkout/AgreementController.php | |
index 98afaa24..8eaa1642 100644 | |
--- a/app/code/core/Mage/Adminhtml/controllers/Checkout/AgreementController.php | |
+++ b/app/code/core/Mage/Adminhtml/controllers/Checkout/AgreementController.php | |
@@ -33,6 +33,17 @@ | |
*/ | |
class Mage_Adminhtml_Checkout_AgreementController extends Mage_Adminhtml_Controller_Action | |
{ | |
+ /** | |
+ * Controller predispatch method | |
+ * | |
+ * @return Mage_Adminhtml_Controller_Action | |
+ */ | |
+ public function preDispatch() | |
+ { | |
+ $this->_setForcedFormKeyActions('delete'); | |
+ return parent::preDispatch(); | |
+ } | |
+ | |
public function indexAction() | |
{ | |
$this->_title($this->__('Sales'))->_title($this->__('Terms and Conditions')); | |
diff --git a/app/code/core/Mage/Adminhtml/controllers/Newsletter/TemplateController.php b/app/code/core/Mage/Adminhtml/controllers/Newsletter/TemplateController.php | |
index ed546c52..c28df8c1 100644 | |
--- a/app/code/core/Mage/Adminhtml/controllers/Newsletter/TemplateController.php | |
+++ b/app/code/core/Mage/Adminhtml/controllers/Newsletter/TemplateController.php | |
@@ -167,6 +167,11 @@ class Mage_Adminhtml_Newsletter_TemplateController extends Mage_Adminhtml_Contro | |
} | |
try { | |
+ $allowedHtmlTags = ['text', 'styles']; | |
+ if (Mage::helper('adminhtml')->hasTags($request->getParams(), $allowedHtmlTags)) { | |
+ Mage::throwException(Mage::helper('adminhtml')->__('Invalid template data.')); | |
+ } | |
+ | |
$template->addData($request->getParams()) | |
->setTemplateSubject($request->getParam('subject')) | |
->setTemplateCode($request->getParam('code')) | |
diff --git a/app/code/core/Mage/Adminhtml/controllers/Promo/CatalogController.php b/app/code/core/Mage/Adminhtml/controllers/Promo/CatalogController.php | |
index 9962530a..1156592c 100644 | |
--- a/app/code/core/Mage/Adminhtml/controllers/Promo/CatalogController.php | |
+++ b/app/code/core/Mage/Adminhtml/controllers/Promo/CatalogController.php | |
@@ -133,6 +133,9 @@ class Mage_Adminhtml_Promo_CatalogController extends Mage_Adminhtml_Controller_A | |
array('request' => $this->getRequest()) | |
); | |
$data = $this->getRequest()->getPost(); | |
+ if (Mage::helper('adminhtml')->hasTags($data['rule'], array('attribute'), false)) { | |
+ Mage::throwException(Mage::helper('catalogrule')->__('Wrong rule specified')); | |
+ } | |
$data = $this->_filterDates($data, array('from_date', 'to_date')); | |
if ($id = $this->getRequest()->getParam('rule_id')) { | |
$model->load($id); | |
diff --git a/app/code/core/Mage/Adminhtml/controllers/Promo/QuoteController.php b/app/code/core/Mage/Adminhtml/controllers/Promo/QuoteController.php | |
index e9b61cb1..28c77cb8 100644 | |
--- a/app/code/core/Mage/Adminhtml/controllers/Promo/QuoteController.php | |
+++ b/app/code/core/Mage/Adminhtml/controllers/Promo/QuoteController.php | |
@@ -133,6 +133,9 @@ class Mage_Adminhtml_Promo_QuoteController extends Mage_Adminhtml_Controller_Act | |
'adminhtml_controller_salesrule_prepare_save', | |
array('request' => $this->getRequest())); | |
$data = $this->getRequest()->getPost(); | |
+ if (Mage::helper('adminhtml')->hasTags($data['rule'], array('attribute'), false)) { | |
+ Mage::throwException(Mage::helper('catalogrule')->__('Wrong rule specified')); | |
+ } | |
$data = $this->_filterDates($data, array('from_date', 'to_date')); | |
$id = $this->getRequest()->getParam('rule_id'); | |
if ($id) { | |
diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php | |
index 5ac30790..c8ee9a99 100644 | |
--- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php | |
+++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php | |
@@ -151,6 +151,13 @@ class Mage_Adminhtml_Sales_Order_CreateController extends Mage_Adminhtml_Control | |
* Saving order data | |
*/ | |
if ($data = $this->getRequest()->getPost('order')) { | |
+ if ( | |
+ array_key_exists('comment', $data) | |
+ && array_key_exists('reserved_order_id', $data['comment']) | |
+ ) { | |
+ unset($data['comment']['reserved_order_id']); | |
+ } | |
+ | |
$this->_getOrderCreateModel()->importPostData($data); | |
} | |
@@ -477,10 +484,20 @@ class Mage_Adminhtml_Sales_Order_CreateController extends Mage_Adminhtml_Control | |
/** | |
* Saving quote and create order | |
+ * | |
+ * @throws Mage_Core_Exception | |
*/ | |
public function saveAction() | |
{ | |
try { | |
+ $orderData = $this->getRequest()->getPost('order'); | |
+ if ( | |
+ array_key_exists('reserved_order_id', $orderData['comment']) | |
+ && Mage::helper('adminhtml/sales')->hasTags($orderData['comment']['reserved_order_id']) | |
+ ) { | |
+ Mage::throwException($this->__('Invalid order data.')); | |
+ } | |
+ | |
$this->_processActionData('save'); | |
$paymentData = $this->getRequest()->getPost('payment'); | |
if ($paymentData) { | |
diff --git a/app/code/core/Mage/Adminhtml/controllers/SitemapController.php b/app/code/core/Mage/Adminhtml/controllers/SitemapController.php | |
index 9aba874d..ec41ff12 100644 | |
--- a/app/code/core/Mage/Adminhtml/controllers/SitemapController.php | |
+++ b/app/code/core/Mage/Adminhtml/controllers/SitemapController.php | |
@@ -33,6 +33,11 @@ | |
*/ | |
class Mage_Adminhtml_SitemapController extends Mage_Adminhtml_Controller_Action | |
{ | |
+ /** | |
+ * Maximum sitemap name length | |
+ */ | |
+ const MAXIMUM_SITEMAP_NAME_LENGTH = 32; | |
+ | |
/** | |
* Controller predispatch method | |
* | |
@@ -141,6 +146,19 @@ class Mage_Adminhtml_SitemapController extends Mage_Adminhtml_Controller_Action | |
if (!empty($data['sitemap_filename']) && !empty($data['sitemap_path'])) { | |
$path = rtrim($data['sitemap_path'], '\\/') | |
. DS . $data['sitemap_filename']; | |
+ | |
+ // check filename length | |
+ if (strlen($data['sitemap_filename']) > self::MAXIMUM_SITEMAP_NAME_LENGTH) { | |
+ Mage::getSingleton('adminhtml/session')->addError( | |
+ Mage::helper('sitemap')->__( | |
+ 'Please enter a sitemap name with at most %s characters.', | |
+ self::MAXIMUM_SITEMAP_NAME_LENGTH | |
+ )); | |
+ $this->_redirect('*/*/edit', array( | |
+ 'sitemap_id' => $this->getRequest()->getParam('sitemap_id') | |
+ )); | |
+ return; | |
+ } | |
/** @var $validator Mage_Core_Model_File_Validator_AvailablePath */ | |
$validator = Mage::getModel('core/file_validator_availablePath'); | |
/** @var $helper Mage_Adminhtml_Helper_Catalog */ | |
diff --git a/app/code/core/Mage/Adminhtml/controllers/System/Email/TemplateController.php b/app/code/core/Mage/Adminhtml/controllers/System/Email/TemplateController.php | |
index 2bd9f964..4e3de6cb 100644 | |
--- a/app/code/core/Mage/Adminhtml/controllers/System/Email/TemplateController.php | |
+++ b/app/code/core/Mage/Adminhtml/controllers/System/Email/TemplateController.php | |
@@ -111,6 +111,8 @@ class Mage_Adminhtml_System_Email_TemplateController extends Mage_Adminhtml_Cont | |
/** | |
* Save action | |
+ * | |
+ * @throws Mage_Core_Exception | |
*/ | |
public function saveAction() | |
{ | |
@@ -127,6 +129,11 @@ class Mage_Adminhtml_System_Email_TemplateController extends Mage_Adminhtml_Cont | |
} | |
try { | |
+ $allowedHtmlTags = ['template_text', 'styles']; | |
+ if (Mage::helper('adminhtml')->hasTags($request->getParams(), $allowedHtmlTags)) { | |
+ Mage::throwException(Mage::helper('adminhtml')->__('Invalid template data.')); | |
+ } | |
+ | |
$template->setTemplateSubject($request->getParam('template_subject')) | |
->setTemplateCode($request->getParam('template_code')) | |
->setTemplateText($request->getParam('template_text')) | |
diff --git a/app/code/core/Mage/Catalog/Helper/Product.php b/app/code/core/Mage/Catalog/Helper/Product.php | |
index e9c0146d..b62e34da 100644 | |
--- a/app/code/core/Mage/Catalog/Helper/Product.php | |
+++ b/app/code/core/Mage/Catalog/Helper/Product.php | |
@@ -525,4 +525,41 @@ class Mage_Catalog_Helper_Product extends Mage_Core_Helper_Url | |
return $qty; | |
} | |
+ | |
+ /** | |
+ * Get default product value by field name | |
+ * | |
+ * @param string $fieldName | |
+ * @param string $productType | |
+ * @return int | |
+ */ | |
+ public function getDefaultProductValue($fieldName, $productType) | |
+ { | |
+ $fieldData = $this->getFieldset($fieldName) ? (array) $this->getFieldset($fieldName) : null; | |
+ if ( | |
+ count($fieldData) | |
+ && array_key_exists($productType, $fieldData['product_type']) | |
+ && (bool)$fieldData['use_config'] | |
+ ) { | |
+ return $fieldData['inventory']; | |
+ } | |
+ return self::DEFAULT_QTY; | |
+ } | |
+ | |
+ /** | |
+ * Return array from config by fieldset name and area | |
+ * | |
+ * @param null|string $field | |
+ * @param string $fieldset | |
+ * @param string $area | |
+ * @return array|null | |
+ */ | |
+ public function getFieldset($field = null, $fieldset = 'catalog_product_dataflow', $area = 'admin') | |
+ { | |
+ $fieldsetData = Mage::getConfig()->getFieldset($fieldset, $area); | |
+ if ($fieldsetData) { | |
+ return $fieldsetData ? $fieldsetData->$field : $fieldsetData; | |
+ } | |
+ return $fieldsetData; | |
+ } | |
} | |
diff --git a/app/code/core/Mage/Catalog/controllers/Product/CompareController.php b/app/code/core/Mage/Catalog/controllers/Product/CompareController.php | |
index 2be9c529..0984c2b7 100644 | |
--- a/app/code/core/Mage/Catalog/controllers/Product/CompareController.php | |
+++ b/app/code/core/Mage/Catalog/controllers/Product/CompareController.php | |
@@ -80,7 +80,7 @@ class Mage_Catalog_Product_CompareController extends Mage_Core_Controller_Front_ | |
} | |
$productId = (int) $this->getRequest()->getParam('product'); | |
- if ($productId | |
+ if ($this->isProductAvailable($productId) | |
&& (Mage::getSingleton('log/visitor')->getId() || Mage::getSingleton('customer/session')->isLoggedIn()) | |
) { | |
$product = Mage::getModel('catalog/product') | |
@@ -106,7 +106,8 @@ class Mage_Catalog_Product_CompareController extends Mage_Core_Controller_Front_ | |
*/ | |
public function removeAction() | |
{ | |
- if ($productId = (int) $this->getRequest()->getParam('product')) { | |
+ $productId = (int) $this->getRequest()->getParam('product'); | |
+ if ($this->isProductAvailable($productId)) { | |
$product = Mage::getModel('catalog/product') | |
->setStoreId(Mage::app()->getStore()->getId()) | |
->load($productId); | |
@@ -184,4 +185,15 @@ class Mage_Catalog_Product_CompareController extends Mage_Core_Controller_Front_ | |
$this->_customerId = $id; | |
return $this; | |
} | |
+ | |
+ /** | |
+ * Check if product is available | |
+ * | |
+ * @param int $productId | |
+ * @return bool | |
+ */ | |
+ public function isProductAvailable($productId) | |
+ { | |
+ return Mage::getModel('catalog/product')->load($productId)->isAvailable(); | |
+ } | |
} | |
diff --git a/app/code/core/Mage/Checkout/Model/Session.php b/app/code/core/Mage/Checkout/Model/Session.php | |
index fc99aa61..dded4661 100644 | |
--- a/app/code/core/Mage/Checkout/Model/Session.php | |
+++ b/app/code/core/Mage/Checkout/Model/Session.php | |
@@ -120,13 +120,21 @@ class Mage_Checkout_Model_Session extends Mage_Core_Model_Session_Abstract | |
if ($this->_quote === null) { | |
/** @var $quote Mage_Sales_Model_Quote */ | |
$quote = Mage::getModel('sales/quote')->setStoreId(Mage::app()->getStore()->getId()); | |
+ $customerSession = Mage::getSingleton('customer/session'); | |
+ | |
if ($this->getQuoteId()) { | |
if ($this->_loadInactive) { | |
$quote->load($this->getQuoteId()); | |
} else { | |
$quote->loadActive($this->getQuoteId()); | |
} | |
- if ($quote->getId()) { | |
+ if ( | |
+ $quote->getId() | |
+ && ( | |
+ ($customerSession->isLoggedIn() && $customerSession->getId() == $quote->getCustomerId()) | |
+ || (!$customerSession->isLoggedIn() && !$quote->getCustomerId()) | |
+ ) | |
+ ) { | |
/** | |
* If current currency code of quote is not equal current currency code of store, | |
* need recalculate totals of quote. It is possible if customer use currency switcher or | |
@@ -143,16 +151,16 @@ class Mage_Checkout_Model_Session extends Mage_Core_Model_Session_Abstract | |
$quote->load($this->getQuoteId()); | |
} | |
} else { | |
+ $quote->unsetData(); | |
$this->setQuoteId(null); | |
} | |
} | |
- $customerSession = Mage::getSingleton('customer/session'); | |
- | |
if (!$this->getQuoteId()) { | |
if ($customerSession->isLoggedIn() || $this->_customer) { | |
$customer = ($this->_customer) ? $this->_customer : $customerSession->getCustomer(); | |
$quote->loadByCustomer($customer); | |
+ $quote->setCustomer($customer); | |
$this->setQuoteId($quote->getId()); | |
} else { | |
$quote->setIsCheckoutCart(true); | |
diff --git a/app/code/core/Mage/Checkout/controllers/OnepageController.php b/app/code/core/Mage/Checkout/controllers/OnepageController.php | |
index 1e122fac..861b9207 100644 | |
--- a/app/code/core/Mage/Checkout/controllers/OnepageController.php | |
+++ b/app/code/core/Mage/Checkout/controllers/OnepageController.php | |
@@ -565,7 +565,7 @@ class Mage_Checkout_OnepageController extends Mage_Checkout_Controller_Action | |
*/ | |
public function saveOrderAction() | |
{ | |
- if (!$this->_validateFormKey()) { | |
+ if ($this->isFormkeyValidationOnCheckoutEnabled() && !$this->_validateFormKey()) { | |
$this->_redirect('*/*'); | |
return; | |
} | |
diff --git a/app/code/core/Mage/Cms/Helper/Data.php b/app/code/core/Mage/Cms/Helper/Data.php | |
index 42b3b181..2b603229 100644 | |
--- a/app/code/core/Mage/Cms/Helper/Data.php | |
+++ b/app/code/core/Mage/Cms/Helper/Data.php | |
@@ -37,6 +37,7 @@ class Mage_Cms_Helper_Data extends Mage_Core_Helper_Abstract | |
const XML_NODE_PAGE_TEMPLATE_FILTER = 'global/cms/page/tempate_filter'; | |
const XML_NODE_BLOCK_TEMPLATE_FILTER = 'global/cms/block/tempate_filter'; | |
const XML_NODE_ALLOWED_STREAM_WRAPPERS = 'global/cms/allowed_stream_wrappers'; | |
+ const XML_NODE_ALLOWED_MEDIA_EXT_SWF = 'adminhtml/cms/browser/extensions/media_allowed/swf'; | |
/** | |
* Retrieve Template processor for Page Content | |
@@ -74,4 +75,19 @@ class Mage_Cms_Helper_Data extends Mage_Core_Helper_Abstract | |
return is_array($allowedStreamWrappers) ? $allowedStreamWrappers : array(); | |
} | |
+ | |
+ /** | |
+ * Check is swf file extension disabled | |
+ * | |
+ * @return bool | |
+ */ | |
+ public function isSwfDisabled() | |
+ { | |
+ $statusSwf = Mage::getConfig()->getNode(self::XML_NODE_ALLOWED_MEDIA_EXT_SWF); | |
+ if ($statusSwf instanceof Mage_Core_Model_Config_Element) { | |
+ $statusSwf = $statusSwf->asArray()[0]; | |
+ } | |
+ | |
+ return $statusSwf ? false : true; | |
+ } | |
} | |
diff --git a/app/code/core/Mage/Cms/Model/Wysiwyg/Config.php b/app/code/core/Mage/Cms/Model/Wysiwyg/Config.php | |
index 471f10fa..33c16b6b 100644 | |
--- a/app/code/core/Mage/Cms/Model/Wysiwyg/Config.php | |
+++ b/app/code/core/Mage/Cms/Model/Wysiwyg/Config.php | |
@@ -93,7 +93,8 @@ class Mage_Cms_Model_Wysiwyg_Config extends Varien_Object | |
'content_css' => | |
Mage::getBaseUrl('js').'mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/content.css', | |
'width' => '100%', | |
- 'plugins' => array() | |
+ 'plugins' => array(), | |
+ 'media_disable_flash' => Mage::helper('cms')->isSwfDisabled() | |
)); | |
$config->setData('directives_url_quoted', preg_quote($config->getData('directives_url'))); | |
diff --git a/app/code/core/Mage/Cms/etc/config.xml b/app/code/core/Mage/Cms/etc/config.xml | |
index a75a7fb1..7458f93e 100644 | |
--- a/app/code/core/Mage/Cms/etc/config.xml | |
+++ b/app/code/core/Mage/Cms/etc/config.xml | |
@@ -122,7 +122,7 @@ | |
</image_allowed> | |
<media_allowed> | |
<flv>1</flv> | |
- <swf>1</swf> | |
+ <swf>0</swf> | |
<avi>1</avi> | |
<mov>1</mov> | |
<rm>1</rm> | |
diff --git a/app/code/core/Mage/Compiler/Model/Process.php b/app/code/core/Mage/Compiler/Model/Process.php | |
index 1f7994e9..73fd07e6 100644 | |
--- a/app/code/core/Mage/Compiler/Model/Process.php | |
+++ b/app/code/core/Mage/Compiler/Model/Process.php | |
@@ -43,6 +43,9 @@ class Mage_Compiler_Model_Process | |
protected $_controllerFolders = array(); | |
+ /** $_collectLibs library list array */ | |
+ protected $_collectLibs = array(); | |
+ | |
public function __construct($options=array()) | |
{ | |
if (isset($options['compile_dir'])) { | |
@@ -128,6 +131,9 @@ class Mage_Compiler_Model_Process | |
|| !in_array(substr($source, strlen($source)-4, 4), array('.php'))) { | |
return $this; | |
} | |
+ if (!$firstIteration && stripos($source, Mage::getBaseDir('lib') . DS) !== false) { | |
+ $this->_collectLibs[] = $target; | |
+ } | |
copy($source, $target); | |
} | |
return $this; | |
@@ -341,6 +347,11 @@ class Mage_Compiler_Model_Process | |
{ | |
$sortedClasses = array(); | |
foreach ($classes as $className) { | |
+ /** Skip iteration if this class has already been moved to the includes folder from the lib */ | |
+ if (array_search($this->_includeDir . DS . $className . '.php', $this->_collectLibs)) { | |
+ continue; | |
+ } | |
+ | |
$implements = array_reverse(class_implements($className)); | |
foreach ($implements as $class) { | |
if (!in_array($class, $sortedClasses) && !in_array($class, $this->_processedClasses) && strstr($class, '_')) { | |
diff --git a/app/code/core/Mage/Core/Helper/Abstract.php b/app/code/core/Mage/Core/Helper/Abstract.php | |
index ea847e3c..b122553f 100644 | |
--- a/app/code/core/Mage/Core/Helper/Abstract.php | |
+++ b/app/code/core/Mage/Core/Helper/Abstract.php | |
@@ -443,4 +443,42 @@ abstract class Mage_Core_Helper_Abstract | |
} | |
return $arr; | |
} | |
+ | |
+ /** | |
+ * Check for tags in multidimensional arrays | |
+ * | |
+ * @param string|array $data | |
+ * @param array $arrayKeys keys of the array being checked that are excluded and included in the check | |
+ * @param bool $skipTags skip transferred array keys, if false then check only them | |
+ * @return bool | |
+ */ | |
+ public function hasTags($data, array $arrayKeys = array(), $skipTags = true) | |
+ { | |
+ if (is_array($data)) { | |
+ foreach ($data as $key => $item) { | |
+ if ($skipTags && in_array($key, $arrayKeys)) { | |
+ continue; | |
+ } | |
+ if (is_array($item)) { | |
+ if ($this->hasTags($item, $arrayKeys, $skipTags)) { | |
+ return true; | |
+ } | |
+ } elseif ( | |
+ (bool)strcmp($item, $this->removeTags($item)) | |
+ || (bool)strcmp($key, $this->removeTags($key)) | |
+ ) { | |
+ if (!$skipTags && !in_array($key, $arrayKeys)) { | |
+ continue; | |
+ } | |
+ return true; | |
+ } | |
+ } | |
+ return false; | |
+ } elseif (is_string($data)) { | |
+ if ((bool)strcmp($data, $this->removeTags($data))) { | |
+ return true; | |
+ } | |
+ } | |
+ return false; | |
+ } | |
} | |
diff --git a/app/code/core/Mage/Core/Helper/Data.php b/app/code/core/Mage/Core/Helper/Data.php | |
index e2e41b41..f4deb30f 100644 | |
--- a/app/code/core/Mage/Core/Helper/Data.php | |
+++ b/app/code/core/Mage/Core/Helper/Data.php | |
@@ -254,7 +254,7 @@ class Mage_Core_Helper_Data extends Mage_Core_Helper_Abstract | |
$chars = self::CHARS_LOWERS . self::CHARS_UPPERS . self::CHARS_DIGITS; | |
} | |
for ($i = 0, $str = '', $lc = strlen($chars)-1; $i < $len; $i++) { | |
- $str .= $chars[mt_rand(0, $lc)]; | |
+ $str .= $chars[random_int(0, $lc)]; | |
} | |
return $str; | |
} | |
diff --git a/app/code/core/Mage/Core/Model/Design/Package.php b/app/code/core/Mage/Core/Model/Design/Package.php | |
index d0587e82..407524a4 100644 | |
--- a/app/code/core/Mage/Core/Model/Design/Package.php | |
+++ b/app/code/core/Mage/Core/Model/Design/Package.php | |
@@ -589,7 +589,11 @@ class Mage_Core_Model_Design_Package | |
return false; | |
} | |
- $regexps = @unserialize($configValueSerialized); | |
+ try { | |
+ $regexps = Mage::helper('core/unserializeArray')->unserialize($configValueSerialized); | |
+ } catch (Exception $e) { | |
+ Mage::logException($e); | |
+ } | |
if (empty($regexps)) { | |
return false; | |
diff --git a/app/code/core/Mage/Core/Model/Email/Template/Filter.php b/app/code/core/Mage/Core/Model/Email/Template/Filter.php | |
index 2d643071..2dd2b2f5 100644 | |
--- a/app/code/core/Mage/Core/Model/Email/Template/Filter.php | |
+++ b/app/code/core/Mage/Core/Model/Email/Template/Filter.php | |
@@ -564,4 +564,24 @@ class Mage_Core_Model_Email_Template_Filter extends Varien_Filter_Template | |
} | |
return $value; | |
} | |
+ | |
+ /** | |
+ * Return variable value for var construction | |
+ * | |
+ * @param string $value raw parameters | |
+ * @param string $default default value | |
+ * @return string | |
+ */ | |
+ protected function _getVariable($value, $default = '{no_value_defined}') | |
+ { | |
+ Mage::register('varProcessing', true); | |
+ try { | |
+ $result = parent::_getVariable($value, $default); | |
+ } catch (Exception $e) { | |
+ $result = ''; | |
+ Mage::logException($e); | |
+ } | |
+ Mage::unregister('varProcessing'); | |
+ return $result; | |
+ } | |
} | |
diff --git a/app/code/core/Mage/Core/Model/File/Validator/AvailablePath.php b/app/code/core/Mage/Core/Model/File/Validator/AvailablePath.php | |
index ca5a6646..0a6ed4fc 100644 | |
--- a/app/code/core/Mage/Core/Model/File/Validator/AvailablePath.php | |
+++ b/app/code/core/Mage/Core/Model/File/Validator/AvailablePath.php | |
@@ -230,8 +230,16 @@ class Mage_Core_Model_File_Validator_AvailablePath extends Zend_Validate_Abstrac | |
} | |
//validation | |
+ $protectedExtensions = Mage::helper('core/data')->getProtectedFileExtensions(); | |
$value = str_replace(array('/', '\\'), DS, $this->_value); | |
$valuePathInfo = pathinfo(ltrim($value, '\\/')); | |
+ $fileNameExtension = pathinfo($valuePathInfo['filename'], PATHINFO_EXTENSION); | |
+ | |
+ if (in_array($fileNameExtension, $protectedExtensions)) { | |
+ $this->_error(self::NOT_AVAILABLE_PATH, $this->_value); | |
+ return false; | |
+ } | |
+ | |
if ($valuePathInfo['dirname'] == '.' || $valuePathInfo['dirname'] == DS) { | |
$valuePathInfo['dirname'] = ''; | |
} | |
diff --git a/app/code/core/Mage/Core/Model/Observer.php b/app/code/core/Mage/Core/Model/Observer.php | |
index 0d570bec..ff562d83 100644 | |
--- a/app/code/core/Mage/Core/Model/Observer.php | |
+++ b/app/code/core/Mage/Core/Model/Observer.php | |
@@ -125,4 +125,19 @@ class Mage_Core_Model_Observer | |
Mage::app()->cleanCache($tags); | |
return $this; | |
} | |
+ | |
+ /** | |
+ * Checks method availability for processing in variable | |
+ * | |
+ * @param Varien_Event_Observer $observer | |
+ * @throws Exception | |
+ * @return Mage_Core_Model_Observer | |
+ */ | |
+ public function secureVarProcessing(Varien_Event_Observer $observer) | |
+ { | |
+ if (Mage::registry('varProcessing')) { | |
+ Mage::throwException(Mage::helper('core')->__('Disallowed template variable method.')); | |
+ } | |
+ return $this; | |
+ } | |
} | |
diff --git a/app/code/core/Mage/Core/etc/config.xml b/app/code/core/Mage/Core/etc/config.xml | |
index d0b5293d..7abca938 100644 | |
--- a/app/code/core/Mage/Core/etc/config.xml | |
+++ b/app/code/core/Mage/Core/etc/config.xml | |
@@ -178,6 +178,22 @@ | |
</security_domain_policy> | |
</observers> | |
</controller_action_predispatch> | |
+ <model_save_before> | |
+ <observers> | |
+ <secure_var_processing> | |
+ <class>core/observer</class> | |
+ <method>secureVarProcessing</method> | |
+ </secure_var_processing> | |
+ </observers> | |
+ </model_save_before> | |
+ <model_delete_before> | |
+ <observers> | |
+ <secure_var_processing> | |
+ <class>core/observer</class> | |
+ <method>secureVarProcessing</method> | |
+ </secure_var_processing> | |
+ </observers> | |
+ </model_delete_before> | |
</events> | |
</global> | |
<frontend> | |
diff --git a/app/code/core/Mage/Core/functions.php b/app/code/core/Mage/Core/functions.php | |
index 3def24ef..fc6e837b 100644 | |
--- a/app/code/core/Mage/Core/functions.php | |
+++ b/app/code/core/Mage/Core/functions.php | |
@@ -397,3 +397,19 @@ if (!function_exists('hash_equals')) { | |
return 0 === $result; | |
} | |
} | |
+ | |
+if (version_compare(PHP_VERSION, '7.0.0', '<') && !function_exists('random_int')) { | |
+ /** | |
+ * Generates pseudo-random integers | |
+ * | |
+ * @param int $min | |
+ * @param int $max | |
+ * @return int Returns random integer in the range $min to $max, inclusive. | |
+ */ | |
+ function random_int($min, $max) | |
+ { | |
+ mt_srand(); | |
+ | |
+ return mt_rand($min, $max); | |
+ } | |
+} | |
diff --git a/app/code/core/Mage/CurrencySymbol/Model/System/Currencysymbol.php b/app/code/core/Mage/CurrencySymbol/Model/System/Currencysymbol.php | |
index d92bae1f..31a27836 100644 | |
--- a/app/code/core/Mage/CurrencySymbol/Model/System/Currencysymbol.php | |
+++ b/app/code/core/Mage/CurrencySymbol/Model/System/Currencysymbol.php | |
@@ -274,7 +274,11 @@ class Mage_CurrencySymbol_Model_System_Currencysymbol | |
$result = array(); | |
$configData = (string)Mage::getStoreConfig($configPath, $storeId); | |
if ($configData) { | |
- $result = unserialize($configData); | |
+ try { | |
+ $result = Mage::helper('core/unserializeArray')->unserialize($configData); | |
+ } catch (Exception $e) { | |
+ Mage::logException($e); | |
+ } | |
} | |
return is_array($result) ? $result : array(); | |
diff --git a/app/code/core/Mage/Downloadable/controllers/DownloadController.php b/app/code/core/Mage/Downloadable/controllers/DownloadController.php | |
index 180e0133..07e7fe38 100644 | |
--- a/app/code/core/Mage/Downloadable/controllers/DownloadController.php | |
+++ b/app/code/core/Mage/Downloadable/controllers/DownloadController.php | |
@@ -97,7 +97,12 @@ class Mage_Downloadable_DownloadController extends Mage_Core_Controller_Front_Ac | |
{ | |
$sampleId = $this->getRequest()->getParam('sample_id', 0); | |
$sample = Mage::getModel('downloadable/sample')->load($sampleId); | |
- if ($sample->getId()) { | |
+ if ( | |
+ $sample->getId() | |
+ && Mage::helper('catalog/product') | |
+ ->getProduct((int) $sample->getProductId(), Mage::app()->getStore()->getId(), 'id') | |
+ ->isAvailable() | |
+ ) { | |
$resource = ''; | |
$resourceType = ''; | |
if ($sample->getSampleType() == Mage_Downloadable_Helper_Download::LINK_TYPE_URL) { | |
@@ -127,7 +132,12 @@ class Mage_Downloadable_DownloadController extends Mage_Core_Controller_Front_Ac | |
{ | |
$linkId = $this->getRequest()->getParam('link_id', 0); | |
$link = Mage::getModel('downloadable/link')->load($linkId); | |
- if ($link->getId()) { | |
+ if ( | |
+ $link->getId() | |
+ && Mage::helper('catalog/product') | |
+ ->getProduct((int) $link->getProductId(), Mage::app()->getStore()->getId(), 'id') | |
+ ->isAvailable() | |
+ ) { | |
$resource = ''; | |
$resourceType = ''; | |
if ($link->getSampleType() == Mage_Downloadable_Helper_Download::LINK_TYPE_URL) { | |
diff --git a/app/code/core/Mage/SalesRule/Model/Coupon/Massgenerator.php b/app/code/core/Mage/SalesRule/Model/Coupon/Massgenerator.php | |
index a9683a00..9df17320 100644 | |
--- a/app/code/core/Mage/SalesRule/Model/Coupon/Massgenerator.php | |
+++ b/app/code/core/Mage/SalesRule/Model/Coupon/Massgenerator.php | |
@@ -79,7 +79,7 @@ class Mage_SalesRule_Model_Coupon_Massgenerator extends Mage_Core_Model_Abstract | |
$code = ''; | |
$charsetSize = count($charset); | |
for ($i=0; $i<$length; $i++) { | |
- $char = $charset[mt_rand(0, $charsetSize - 1)]; | |
+ $char = $charset[random_int(0, $charsetSize - 1)]; | |
if ($split > 0 && ($i % $split) == 0 && $i != 0) { | |
$char = $splitChar . $char; | |
} | |
diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Createdat.php b/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Createdat.php | |
index bfda23b8..f574602d 100644 | |
--- a/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Createdat.php | |
+++ b/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Createdat.php | |
@@ -118,14 +118,14 @@ class Mage_SalesRule_Model_Resource_Report_Rule_Createdat extends Mage_Reports_M | |
$adapter->getIfNullSql('base_subtotal_refunded', 0). ') * base_to_global_rate)', 0), | |
'discount_amount_actual' => | |
- $adapter->getIfNullSql('SUM((base_discount_invoiced - ' . | |
+ $adapter->getIfNullSql('SUM((ABS(base_discount_invoiced) - ' . | |
$adapter->getIfNullSql('base_discount_refunded', 0) . ') | |
* base_to_global_rate)', 0), | |
'total_amount_actual' => | |
$adapter->getIfNullSql('SUM((base_subtotal_invoiced - ' . | |
$adapter->getIfNullSql('base_subtotal_refunded', 0) . ' - ' . | |
- $adapter->getIfNullSql('base_discount_invoiced - ' . | |
+ $adapter->getIfNullSql('ABS(base_discount_invoiced) - ' . | |
$adapter->getIfNullSql('base_discount_refunded', 0), 0) . | |
') * base_to_global_rate)', 0), | |
); | |
diff --git a/app/code/core/Mage/Sendfriend/etc/config.xml b/app/code/core/Mage/Sendfriend/etc/config.xml | |
index 5b21374f..3ef8964d 100644 | |
--- a/app/code/core/Mage/Sendfriend/etc/config.xml | |
+++ b/app/code/core/Mage/Sendfriend/etc/config.xml | |
@@ -122,7 +122,7 @@ | |
<default> | |
<sendfriend> | |
<email> | |
- <enabled>1</enabled> | |
+ <enabled>0</enabled> | |
<template>sendfriend_email_template</template> | |
<allow_guest>0</allow_guest> | |
<max_recipients>5</max_recipients> | |
diff --git a/app/code/core/Mage/Sendfriend/etc/system.xml b/app/code/core/Mage/Sendfriend/etc/system.xml | |
index 6f43d9cc..2beaf38c 100644 | |
--- a/app/code/core/Mage/Sendfriend/etc/system.xml | |
+++ b/app/code/core/Mage/Sendfriend/etc/system.xml | |
@@ -52,6 +52,7 @@ | |
<show_in_default>1</show_in_default> | |
<show_in_website>1</show_in_website> | |
<show_in_store>1</show_in_store> | |
+ <comment><![CDATA[<strong style="color:red">Warning!</strong> This functionality is vulnerable and can be abused to distribute spam.]]></comment> | |
</enabled> | |
<template translate="label"> | |
<label>Select Email Template</label> | |
diff --git a/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/configurable.phtml b/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/configurable.phtml | |
index 5452fe7d..9d08a10d 100644 | |
--- a/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/configurable.phtml | |
+++ b/app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/configurable.phtml | |
@@ -35,7 +35,7 @@ | |
<div class="product-options"> | |
<dl> | |
<?php foreach($_attributes as $_attribute): ?> | |
- <dt><label class="required"><em>*</em><?php echo $_attribute->getLabel() ?></label></dt> | |
+ <dt><label class="required"><em>*</em><?php echo $this->escapeHtml($_attribute->getLabel()) ?></label></dt> | |
<dd<?php if ($_attribute->decoratedIsLast){?> class="last"<?php }?>> | |
<div class="input-box"> | |
<select name="super_attribute[<?php echo $_attribute->getAttributeId() ?>]" id="attribute<?php echo $_attribute->getAttributeId() ?>" class="required-entry super-attribute-select"> | |
diff --git a/app/design/adminhtml/default/default/template/catalog/product/helper/gallery.phtml b/app/design/adminhtml/default/default/template/catalog/product/helper/gallery.phtml | |
index cc622107..5d31b62c 100644 | |
--- a/app/design/adminhtml/default/default/template/catalog/product/helper/gallery.phtml | |
+++ b/app/design/adminhtml/default/default/template/catalog/product/helper/gallery.phtml | |
@@ -59,7 +59,7 @@ $_block = $this; | |
<th><?php echo Mage::helper('catalog')->__('Label') ?></th> | |
<th><?php echo Mage::helper('catalog')->__('Sort Order') ?></th> | |
<?php foreach ($_block->getImageTypes() as $typeId => $type): ?> | |
- <th><?php echo $this->escapeHtml($type['label']); ?></th> | |
+ <th><?php echo $this->escapeHtml($type['label'], array('br')); ?></th> | |
<?php endforeach; ?> | |
<th><?php echo Mage::helper('catalog')->__('Exclude') ?></th> | |
<th class="last"><?php echo Mage::helper('catalog')->__('Remove') ?></th> | |
diff --git a/app/design/adminhtml/default/default/template/catalog/product/tab/inventory.phtml b/app/design/adminhtml/default/default/template/catalog/product/tab/inventory.phtml | |
index a0fd72df..e05ecf3d 100644 | |
--- a/app/design/adminhtml/default/default/template/catalog/product/tab/inventory.phtml | |
+++ b/app/design/adminhtml/default/default/template/catalog/product/tab/inventory.phtml | |
@@ -77,7 +77,7 @@ | |
<tr> | |
<td class="label"><label for="inventory_min_sale_qty"><?php echo Mage::helper('catalog')->__('Minimum Qty Allowed in Shopping Cart') ?></label></td> | |
- <td class="value"><input type="text" class="input-text validate-number" id="inventory_min_sale_qty" name="<?php echo $this->getFieldSuffix() ?>[stock_data][min_sale_qty]" value="<?php echo $this->getFieldValue('min_sale_qty')*1 ?>" <?php echo $_readonly;?>/> | |
+ <td class="value"><input type="text" class="input-text validate-number" id="inventory_min_sale_qty" name="<?php echo $this->getFieldSuffix() ?>[stock_data][min_sale_qty]" value="<?php echo (bool)$this->getProduct()->getId() ? (int)$this->getFieldValue('min_sale_qty') : Mage::helper('catalog/product')->getDefaultProductValue('min_sale_qty', $this->getProduct()->getTypeId()) ?>" <?php echo $_readonly ?>/> | |
<?php $_checked = ($this->getFieldValue('use_config_min_sale_qty') || $this->IsNew()) ? 'checked="checked"' : '' ?> | |
<input type="checkbox" id="inventory_use_config_min_sale_qty" name="<?php echo $this->getFieldSuffix() ?>[stock_data][use_config_min_sale_qty]" value="1" <?php echo $_checked ?> onclick="toggleValueElements(this, this.parentNode);" class="checkbox" <?php echo $_readonly;?> /> | |
diff --git a/app/design/adminhtml/default/default/template/currencysymbol/grid.phtml b/app/design/adminhtml/default/default/template/currencysymbol/grid.phtml | |
index 597f6419..5a776238 100644 | |
--- a/app/design/adminhtml/default/default/template/currencysymbol/grid.phtml | |
+++ b/app/design/adminhtml/default/default/template/currencysymbol/grid.phtml | |
@@ -66,12 +66,12 @@ | |
<?php foreach($this->getCurrencySymbolsData() as $code => $data): ?> | |
<tr> | |
<td class="label"> | |
- <label for="custom_currency_symbol<?php echo $code; ?>"><?php echo $code; ?> (<?php echo $data['displayName']; ?>)</label> | |
+ <label for="custom_currency_symbol<?php echo $this->escapeHtml($code); ?>"><?php echo $this->escapeHtml($code); ?> (<?php echo $this->escapeHtml($data['displayName']); ?>)</label> | |
</td> | |
<td class="value"> | |
- <input id="custom_currency_symbol<?php echo $code; ?>" class=" required-entry input-text" type="text" value="<?php echo Mage::helper('core')->quoteEscape($data['displaySymbol']); ?>"<?php echo $data['inherited'] ? ' disabled="disabled"' : '';?> name="custom_currency_symbol[<?php echo $code; ?>]"> | |
- <input id="custom_currency_symbol_inherit<?php echo $code; ?>" class="checkbox config-inherit" type="checkbox" onclick="toggleUseDefault(<?php echo '\'' . $code . '\',\'' . Mage::helper('core')->quoteEscape($data['parentSymbol'], true) . '\''; ?>)"<?php echo $data['inherited'] ? ' checked="checked"' : ''; ?> value="1" name="inherit_custom_currency_symbol[<?php echo $code; ?>]"> | |
- <label class="inherit" title="" for="custom_currency_symbol_inherit<?php echo $code; ?>"><?php echo $this->getInheritText(); ?></label> | |
+ <input id="custom_currency_symbol<?php echo $this->escapeHtml($code); ?>" class=" required-entry input-text" type="text" value="<?php echo Mage::helper('core')->quoteEscape($this->escapeHtml($data['displaySymbol'])); ?>"<?php echo $data['inherited'] ? ' disabled="disabled"' : '';?> name="custom_currency_symbol[<?php echo $this->escapeHtml($code); ?>]"> | |
+ <input id="custom_currency_symbol_inherit<?php echo $this->escapeHtml($code); ?>" class="checkbox config-inherit" type="checkbox" onclick="toggleUseDefault(<?php echo '\'' . $this->escapeHtml($code) . '\',\'' . Mage::helper('core')->quoteEscape($data['parentSymbol'], true) . '\''; ?>)"<?php echo $data['inherited'] ? ' checked="checked"' : ''; ?> value="1" name="inherit_custom_currency_symbol[<?php echo $this->escapeHtml($code); ?>]"> | |
+ <label class="inherit" title="" for="custom_currency_symbol_inherit<?php echo $this->escapeHtml($code); ?>"><?php echo $this->getInheritText(); ?></label> | |
</td> | |
</tr> | |
<?php endforeach; ?> | |
diff --git a/app/design/adminhtml/default/default/template/customer/tab/addresses.phtml b/app/design/adminhtml/default/default/template/customer/tab/addresses.phtml | |
index 4e41e32b..c5f793c4 100644 | |
--- a/app/design/adminhtml/default/default/template/customer/tab/addresses.phtml | |
+++ b/app/design/adminhtml/default/default/template/customer/tab/addresses.phtml | |
@@ -46,7 +46,7 @@ | |
</a> | |
<?php endif;?> | |
<address> | |
- <?php echo $_address->format('html') ?> | |
+ <?php echo $this->maliciousCodeFilter($_address->format('html')) ?> | |
</address> | |
<div class="address-type"> | |
<span class="address-type-line"> | |
diff --git a/app/design/adminhtml/default/default/template/customer/tab/view.phtml b/app/design/adminhtml/default/default/template/customer/tab/view.phtml | |
index cd23a757..ea0dd19a 100644 | |
--- a/app/design/adminhtml/default/default/template/customer/tab/view.phtml | |
+++ b/app/design/adminhtml/default/default/template/customer/tab/view.phtml | |
@@ -75,7 +75,7 @@ $createDateStore = $this->getStoreCreateDate(); | |
</table> | |
<address class="box-right"> | |
<strong><?php echo $this->__('Default Billing Address') ?></strong><br/> | |
- <?php echo $this->getBillingAddressHtml() ?> | |
+ <?php echo $this->maliciousCodeFilter($this->getBillingAddressHtml()) ?> | |
</address> | |
</fieldset> | |
</div> | |
diff --git a/app/design/adminhtml/default/default/template/notification/window.phtml b/app/design/adminhtml/default/default/template/notification/window.phtml | |
index 1590005a..1397492f 100644 | |
--- a/app/design/adminhtml/default/default/template/notification/window.phtml | |
+++ b/app/design/adminhtml/default/default/template/notification/window.phtml | |
@@ -68,7 +68,7 @@ | |
</div> | |
<div class="message-popup-content"> | |
<div class="message"> | |
- <span class="message-icon message-<?php echo $this->getSeverityText();?>" style="background-image:url(<?php echo $this->getSeverityIconsUrl() ?>);"><?php echo $this->getSeverityText();?></span> | |
+ <span class="message-icon message-<?php echo $this->getSeverityText(); ?>" style="background-image:url(<?php echo $this->escapeUrl($this->getSeverityIconsUrl()); ?>);"><?php echo $this->getSeverityText(); ?></span> | |
<p class="message-text"><?php echo $this->getNoticeMessageText(); ?></p> | |
</div> | |
<p class="read-more"><a href="<?php echo $this->getNoticeMessageUrl(); ?>" onclick="this.target='_blank';"><?php echo $this->getReadDetailsText(); ?></a></p> | |
diff --git a/app/design/adminhtml/default/default/template/sales/order/create/data.phtml b/app/design/adminhtml/default/default/template/sales/order/create/data.phtml | |
index 82f8a662..d648baee 100644 | |
--- a/app/design/adminhtml/default/default/template/sales/order/create/data.phtml | |
+++ b/app/design/adminhtml/default/default/template/sales/order/create/data.phtml | |
@@ -33,7 +33,9 @@ | |
<?php endforeach; ?> | |
</select> | |
</p> | |
-<script type="text/javascript">order.setCurrencySymbol('<?php echo $this->getCurrencySymbol($this->getCurrentCurrencyCode()) ?>')</script> | |
+ <script type="text/javascript"> | |
+ order.setCurrencySymbol('<?php echo Mage::helper('core')->jsQuoteEscape($this->getCurrencySymbol($this->getCurrentCurrencyCode())) ?>') | |
+ </script> | |
<table cellspacing="0" width="100%"> | |
<tr> | |
<?php if($this->getCustomerId()): ?> | |
diff --git a/app/design/adminhtml/default/default/template/sales/order/view/info.phtml b/app/design/adminhtml/default/default/template/sales/order/view/info.phtml | |
index dcf7d6ad..4bdeabc7 100644 | |
--- a/app/design/adminhtml/default/default/template/sales/order/view/info.phtml | |
+++ b/app/design/adminhtml/default/default/template/sales/order/view/info.phtml | |
@@ -39,9 +39,9 @@ $orderStoreDate = $this->formatDate($_order->getCreatedAtStoreDate(), 'medium', | |
endif; ?> | |
<div class="entry-edit-head"> | |
<?php if ($this->getNoUseOrderLink()): ?> | |
- <h4 class="icon-head head-account"><?php echo Mage::helper('sales')->__('Order # %s', $_order->getRealOrderId()) ?> (<?php echo $_email ?>)</h4> | |
+ <h4 class="icon-head head-account"><?php echo Mage::helper('sales')->__('Order # %s', $this->escapeHtml($_order->getRealOrderId())) ?> (<?php echo $_email ?>)</h4> | |
<?php else: ?> | |
- <a href="<?php echo $this->getViewUrl($_order->getId()) ?>"><?php echo Mage::helper('sales')->__('Order # %s', $_order->getRealOrderId()) ?></a> | |
+ <a href="<?php echo $this->getViewUrl($_order->getId()) ?>"><?php echo Mage::helper('sales')->__('Order # %s', $this->escapeHtml($_order->getRealOrderId())) ?></a> | |
<strong>(<?php echo $_email ?>)</strong> | |
<?php endif; ?> | |
</div> | |
@@ -69,7 +69,7 @@ $orderStoreDate = $this->formatDate($_order->getCreatedAtStoreDate(), 'medium', | |
<tr> | |
<td class="label"><label><?php echo Mage::helper('sales')->__('Link to the New Order') ?></label></td> | |
<td class="value"><a href="<?php echo $this->getViewUrl($_order->getRelationChildId()) ?>"> | |
- <?php echo $_order->getRelationChildRealId() ?> | |
+ <?php echo $this->escapeHtml($_order->getRelationChildRealId()) ?> | |
</a></td> | |
</tr> | |
<?php endif; ?> | |
@@ -77,7 +77,7 @@ $orderStoreDate = $this->formatDate($_order->getCreatedAtStoreDate(), 'medium', | |
<tr> | |
<td class="label"><label><?php echo Mage::helper('sales')->__('Link to the Previous Order') ?></label></td> | |
<td class="value"><a href="<?php echo $this->getViewUrl($_order->getRelationParentId()) ?>"> | |
- <?php echo $_order->getRelationParentRealId() ?> | |
+ <?php echo $this->escapeHtml($_order->getRelationParentRealId()) ?> | |
</a></td> | |
</tr> | |
<?php endif; ?> | |
@@ -154,7 +154,7 @@ $orderStoreDate = $this->formatDate($_order->getCreatedAtStoreDate(), 'medium', | |
<div class="tools"><?php echo $this->getAddressEditLink($_order->getBillingAddress())?></div> | |
</div> | |
<fieldset> | |
- <address><?php echo $_order->getBillingAddress()->getFormated(true) ?></address> | |
+ <address><?php echo $this->maliciousCodeFilter($_order->getBillingAddress()->getFormated(true)) ?></address> | |
</fieldset> | |
</div> | |
</div> | |
@@ -167,7 +167,7 @@ $orderStoreDate = $this->formatDate($_order->getCreatedAtStoreDate(), 'medium', | |
<div class="tools"><?php echo $this->getAddressEditLink($_order->getShippingAddress())?></div> | |
</div> | |
<fieldset> | |
- <address><?php echo $_order->getShippingAddress()->getFormated(true) ?></address> | |
+ <address><?php echo $this->maliciousCodeFilter($_order->getShippingAddress()->getFormated(true)) ?></address> | |
</fieldset> | |
</div> | |
</div> | |
diff --git a/app/design/adminhtml/default/default/template/system/currency/rate/matrix.phtml b/app/design/adminhtml/default/default/template/system/currency/rate/matrix.phtml | |
index 744e6ab2..3e72f559 100644 | |
--- a/app/design/adminhtml/default/default/template/system/currency/rate/matrix.phtml | |
+++ b/app/design/adminhtml/default/default/template/system/currency/rate/matrix.phtml | |
@@ -38,7 +38,7 @@ $_rates = ( $_newRates ) ? $_newRates : $_oldRates; | |
<tr class="headings"> | |
<th class="a-right"> </th> | |
<?php $_i = 0; foreach( $this->getAllowedCurrencies() as $_currencyCode ): ?> | |
- <th class="<?php echo (( ++$_i == (sizeof($this->getAllowedCurrencies())) ) ? 'last' : '' ) ?> a-right"><strong><?php echo $_currencyCode ?><strong></th> | |
+ <th class="<?php echo (( ++$_i == (sizeof($this->getAllowedCurrencies())) ) ? 'last' : '' ) ?> a-right"><strong><?php echo $this->escapeHtml($_currencyCode) ?><strong></th> | |
<?php endforeach; ?> | |
</tr> | |
</thead> | |
@@ -47,16 +47,16 @@ $_rates = ( $_newRates ) ? $_newRates : $_oldRates; | |
<?php if( isset($_rates[$_currencyCode]) && is_array($_rates[$_currencyCode])): ?> | |
<?php foreach( $_rates[$_currencyCode] as $_rate => $_value ): ?> | |
<?php if( ++$_j == 1 ): ?> | |
- <td class="a-right"><strong><?php echo $_currencyCode ?></strong></td> | |
+ <td class="a-right"><strong><?php echo $this->escapeHtml($_currencyCode) ?></strong></td> | |
<td class="a-right"> | |
- <input type="text" name="rate[<?php echo $_currencyCode ?>][<?php echo $_rate ?>]" value="<?php echo ( $_currencyCode == $_rate ) ? '1.0000' : ($_value>0 ? $_value : (isset($_oldRates[$_currencyCode][$_rate]) ? $_oldRates[$_currencyCode][$_rate] : '')) ?>" <?php echo ( $_currencyCode == $_rate ) ? 'class="input-text input-text-disabled" readonly="true"' : 'class="input-text"' ?> /> | |
+ <input type="text" name="rate[<?php echo $this->escapeHtml($_currencyCode) ?>][<?php echo $this->escapeHtml($_rate) ?>]" value="<?php echo ( $_currencyCode == $_rate ) ? '1.0000' : ($_value>0 ? $_value : (isset($_oldRates[$_currencyCode][$_rate]) ? $_oldRates[$_currencyCode][$_rate] : '')) ?>" <?php echo ( $_currencyCode == $_rate ) ? 'class="input-text input-text-disabled" readonly="true"' : 'class="input-text"' ?> /> | |
<?php if( isset($_newRates) && $_currencyCode != $_rate && isset($_oldRates[$_currencyCode][$_rate]) ): ?> | |
<br /><span class="old-rate"><?php echo $this->__('Old rate:') ?> <?php echo $_oldRates[$_currencyCode][$_rate] ?></span> | |
<?php endif; ?> | |
</td> | |
<?php else: ?> | |
<td class="a-right"> | |
- <input type="text" name="rate[<?php echo $_currencyCode ?>][<?php echo $_rate ?>]" value="<?php echo ( $_currencyCode == $_rate ) ? '1.0000' : ($_value>0 ? $_value : (isset($_oldRates[$_currencyCode][$_rate]) ? $_oldRates[$_currencyCode][$_rate] : '')) ?>" <?php echo ( $_currencyCode == $_rate ) ? 'class="input-text input-text-disabled" readonly="true"' : 'class="input-text"' ?> /> | |
+ <input type="text" name="rate[<?php echo $this->escapeHtml($_currencyCode) ?>][<?php echo $this->escapeHtml($_rate) ?>]" value="<?php echo ( $_currencyCode == $_rate ) ? '1.0000' : ($_value>0 ? $_value : (isset($_oldRates[$_currencyCode][$_rate]) ? $_oldRates[$_currencyCode][$_rate] : '')) ?>" <?php echo ( $_currencyCode == $_rate ) ? 'class="input-text input-text-disabled" readonly="true"' : 'class="input-text"' ?> /> | |
<?php if( isset($_newRates) && $_currencyCode != $_rate && isset($_oldRates[$_currencyCode][$_rate]) ): ?> | |
<br /><span class="old-rate"><?php echo $this->__('Old rate:') ?> <?php echo $_oldRates[$_currencyCode][$_rate] ?></span> | |
<?php endif; ?> | |
diff --git a/app/locale/en_US/Mage_Adminhtml.csv b/app/locale/en_US/Mage_Adminhtml.csv | |
index 08b087b7..fb5f3a98 100644 | |
--- a/app/locale/en_US/Mage_Adminhtml.csv | |
+++ b/app/locale/en_US/Mage_Adminhtml.csv | |
@@ -41,7 +41,7 @@ | |
"<h1 class=""page-heading"">404 Error</h1><p>Page not found.</p>","<h1 class=""page-heading"">404 Error</h1><p>Page not found.</p>" | |
"<strong>%s</strong> requests access to your account","<strong>%s</strong> requests access to your account" | |
"<strong>Attention</strong>: Captcha is case sensitive.","<strong>Attention</strong>: Captcha is case sensitive." | |
-"A user with the same user name or email aleady exists.","A user with the same user name or email aleady exists." | |
+"A user with the same user name or email already exists.","A user with the same user name or email already exists." | |
"API Key","API Key" | |
"API Key Confirmation","API Key Confirmation" | |
"ASCII","ASCII" | |
@@ -271,6 +271,7 @@ | |
"Credit memo\'s total must be positive.","Credit memo\'s total must be positive." | |
"Currency","Currency" | |
"Currency ""%s"" is used as %s in %s.","Currency ""%s"" is used as %s in %s." | |
+"Currency doesn\'t exist.","Currency doesn\'t exist." | |
"Currency Information","Currency Information" | |
"Currency Setup Section","Currency Setup Section" | |
"Current Admin Password","Current Admin Password" | |
@@ -936,6 +937,7 @@ | |
"Self-assigned roles cannot be deleted.","Self-assigned roles cannot be deleted." | |
"Sender","Sender" | |
"Separate Email","Separate Email" | |
+"Serialized data is incorrect","Serialized data is incorrect" | |
"Shipment #%s comment added","Shipment #%s comment added" | |
"Shipment #%s created","Shipment #%s created" | |
"Shipment Comments","Shipment Comments" | |
@@ -1055,6 +1057,7 @@ | |
"The email address is empty.","The email address is empty." | |
"The email template has been deleted.","The email template has been deleted." | |
"The email template has been saved.","The email template has been saved." | |
+"Invalid template data.","Invalid template data." | |
"The flat catalog category has been rebuilt.","The flat catalog category has been rebuilt." | |
"The group node name must be specified with field node name.","The group node name must be specified with field node name." | |
"The image cache was cleaned.","The image cache was cleaned." | |
diff --git a/app/locale/en_US/Mage_Core.csv b/app/locale/en_US/Mage_Core.csv | |
index 607dc457..ee35105f 100644 | |
--- a/app/locale/en_US/Mage_Core.csv | |
+++ b/app/locale/en_US/Mage_Core.csv | |
@@ -58,6 +58,7 @@ | |
"Can\'t retrieve entity config: %s","Can\'t retrieve entity config: %s" | |
"Cancel","Cancel" | |
"Cannot complete this operation from non-admin area.","Cannot complete this operation from non-admin area." | |
+"Disallowed template variable method.","Disallowed template variable method." | |
"Card type does not match credit card number.","Card type does not match credit card number." | |
"Code","Code" | |
"Controller file was loaded but class does not exist","Controller file was loaded but class does not exist" | |
diff --git a/app/locale/en_US/Mage_Sales.csv b/app/locale/en_US/Mage_Sales.csv | |
index 5f4a7c68..979837a8 100644 | |
--- a/app/locale/en_US/Mage_Sales.csv | |
+++ b/app/locale/en_US/Mage_Sales.csv | |
@@ -288,6 +288,7 @@ | |
"Invalid draw line data. Please define ""lines"" array.","Invalid draw line data. Please define ""lines"" array." | |
"Invalid entity model","Invalid entity model" | |
"Invalid item option format.","Invalid item option format." | |
+"Invalid order data.","Invalid order data." | |
"Invalid qty to invoice item ""%s""","Invalid qty to invoice item ""%s""" | |
"Invalid qty to refund item ""%s""","Invalid qty to refund item ""%s""" | |
"Invalid qty to ship for item ""%s""","Invalid qty to ship for item ""%s""" | |
diff --git a/app/locale/en_US/Mage_Sitemap.csv b/app/locale/en_US/Mage_Sitemap.csv | |
index 8ae5a947..df201861 100644 | |
--- a/app/locale/en_US/Mage_Sitemap.csv | |
+++ b/app/locale/en_US/Mage_Sitemap.csv | |
@@ -44,3 +44,4 @@ | |
"Valid values range: from 0.0 to 1.0.","Valid values range: from 0.0 to 1.0." | |
"Weekly","Weekly" | |
"Yearly","Yearly" | |
+"Please enter a sitemap name with at most %s characters.","Please enter a sitemap name with at most %s characters." | |
diff --git a/js/mage/adminhtml/wysiwyg/tiny_mce/setup.js b/js/mage/adminhtml/wysiwyg/tiny_mce/setup.js | |
index 88c6f7d9..8fb09cf4 100644 | |
--- a/js/mage/adminhtml/wysiwyg/tiny_mce/setup.js | |
+++ b/js/mage/adminhtml/wysiwyg/tiny_mce/setup.js | |
@@ -365,6 +365,7 @@ tinyMceWysiwygSetup.prototype = | |
theme_advanced_resizing : true, | |
convert_urls : false, | |
relative_urls : false, | |
+ media_disable_flash : this.config.media_disable_flash, | |
content_css: this.config.content_css, | |
custom_popup_css: this.config.popup_css, | |
magentowidget_url: this.config.widget_window_url, | |
diff --git a/js/tiny_mce/plugins/media/js/media.js b/js/tiny_mce/plugins/media/js/media.js | |
index 89cea2a4..b3f7e991 100644 | |
--- a/js/tiny_mce/plugins/media/js/media.js | |
+++ b/js/tiny_mce/plugins/media/js/media.js | |
@@ -483,7 +483,7 @@ | |
html += '<select id="media_type" name="media_type" onchange="Media.formToData(\'type\');">'; | |
html += option("video"); | |
html += option("audio"); | |
- html += option("flash", "object"); | |
+ html += editor.getParam("media_disable_flash") ? '' : option("flash", "object"); | |
html += option("quicktime", "object"); | |
html += option("shockwave", "object"); | |
html += option("windowsmedia", "object"); | |
diff --git a/js/varien/js.js b/js/varien/js.js | |
index 2e0b253b..064029f1 100644 | |
--- a/js/varien/js.js | |
+++ b/js/varien/js.js | |
@@ -717,3 +717,40 @@ if ((typeof Range != "undefined") && !Range.prototype.createContextualFragment) | |
return frag; | |
}; | |
} | |
+ | |
+/** | |
+ * Create form element. Set parameters into it and send | |
+ * | |
+ * @param url | |
+ * @param parametersArray | |
+ * @param method | |
+ */ | |
+Varien.formCreator = Class.create(); | |
+Varien.formCreator.prototype = { | |
+ initialize : function(url, parametersArray, method) { | |
+ this.url = url; | |
+ this.parametersArray = JSON.parse(parametersArray); | |
+ this.method = method; | |
+ this.form = ''; | |
+ | |
+ this.createForm(); | |
+ this.setFormData(); | |
+ }, | |
+ createForm : function() { | |
+ this.form = new Element('form', { 'method': this.method, action: this.url }); | |
+ }, | |
+ setFormData : function () { | |
+ for (var key in this.parametersArray) { | |
+ Element.insert( | |
+ this.form, | |
+ new Element('input', { name: key, value: this.parametersArray[key], type: 'hidden' }) | |
+ ); | |
+ } | |
+ } | |
+}; | |
+ | |
+function customFormSubmit(url, parametersArray, method) { | |
+ var createdForm = new Varien.formCreator(url, parametersArray, method); | |
+ Element.insert($$('body')[0], createdForm.form); | |
+ createdForm.form.submit(); | |
+} | |
diff --git a/lib/phpseclib/PHP/Compat/Function/array_fill.php b/lib/phpseclib/PHP/Compat/Function/array_fill.php | |
index 79b5312a..7eb231a0 100644 | |
--- a/lib/phpseclib/PHP/Compat/Function/array_fill.php | |
+++ b/lib/phpseclib/PHP/Compat/Function/array_fill.php | |
@@ -14,6 +14,7 @@ | |
* @version $Revision: 1.1 $ | |
* @since PHP 4.2.0 | |
*/ | |
+/* | |
function php_compat_array_fill($start_index, $num, $value) | |
{ | |
if ($num <= 0) { | |
@@ -39,3 +40,4 @@ if (!function_exists('array_fill')) { | |
return php_compat_array_fill($start_index, $num, $value); | |
} | |
} | |
+*/ | |
diff --git a/lib/phpseclib/PHP/Compat/Function/bcpowmod.php b/lib/phpseclib/PHP/Compat/Function/bcpowmod.php | |
index 4c162b87..0366fef8 100644 | |
--- a/lib/phpseclib/PHP/Compat/Function/bcpowmod.php | |
+++ b/lib/phpseclib/PHP/Compat/Function/bcpowmod.php | |
@@ -15,6 +15,7 @@ | |
* @since PHP 5.0.0 | |
* @require PHP 4.0.0 (user_error) | |
*/ | |
+/* | |
function php_compat_bcpowmod($x, $y, $modulus, $scale = 0) | |
{ | |
// Sanity check | |
@@ -64,3 +65,4 @@ if (!function_exists('bcpowmod')) { | |
return php_compat_bcpowmod($x, $y, $modulus, $scale); | |
} | |
} | |
+*/ | |
diff --git a/lib/phpseclib/PHP/Compat/Function/str_split.php b/lib/phpseclib/PHP/Compat/Function/str_split.php | |
index 8f5179bc..607e5ca3 100644 | |
--- a/lib/phpseclib/PHP/Compat/Function/str_split.php | |
+++ b/lib/phpseclib/PHP/Compat/Function/str_split.php | |
@@ -12,6 +12,7 @@ | |
* @since PHP 5 | |
* @require PHP 4.0.0 (user_error) | |
*/ | |
+/* | |
function php_compat_str_split($string, $split_length = 1) | |
{ | |
if (!is_scalar($split_length)) { | |
@@ -57,3 +58,4 @@ if (!function_exists('str_split')) { | |
return php_compat_str_split($string, $split_length); | |
} | |
} | |
+*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment