From 9632acbc25d899f30acd45cbc9ae88c468751488 Mon Sep 17 00:00:00 2001 From: Tobias Baer Date: Thu, 13 Jul 2017 10:03:51 +0200 Subject: [PATCH] Applied Patch SUPEE-9767 v2 --- .../Model/System/Config/Backend/Symlink.php | 44 +++++++++++++++++++ .../controllers/OnepageController.php | 4 -- .../Mage/Core/Model/File/Validator/Image.php | 20 ++++++++- app/code/core/Mage/Core/etc/config.xml | 2 +- app/code/core/Mage/Core/etc/system.xml | 21 +++++++++ .../upgrade-1.6.0.6.1.1-1.6.0.6.1.2.php | 40 +++++++++++++++++ .../adminhtml/default/default/layout/main.xml | 3 +- .../oauth/authorize/head-simple.phtml | 2 +- .../checkout/multishipping/addresses.phtml | 1 + .../template/checkout/onepage/payment.phtml | 2 +- .../template/checkout/onepage/payment.phtml | 2 +- app/etc/applied.patches.list | 14 ++++++ 12 files changed, 145 insertions(+), 10 deletions(-) create mode 100644 app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Symlink.php create mode 100644 app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.6.1.1-1.6.0.6.1.2.php create mode 100644 app/etc/applied.patches.list diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Symlink.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Symlink.php new file mode 100644 index 00000000000..d211255d723 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Symlink.php @@ -0,0 +1,44 @@ +isFormkeyValidationOnCheckoutEnabled() && !$this->_validateFormKey()) { - return; - } - if ($this->getRequest()->isPost()) { $method = $this->getRequest()->getPost('method'); $result = $this->getOnepage()->saveCheckoutMethod($method); diff --git a/app/code/core/Mage/Core/Model/File/Validator/Image.php b/app/code/core/Mage/Core/Model/File/Validator/Image.php index e24f8b983b4..9d572021a72 100644 --- a/app/code/core/Mage/Core/Model/File/Validator/Image.php +++ b/app/code/core/Mage/Core/Model/File/Validator/Image.php @@ -95,9 +95,26 @@ public function validate($filePath) $image = imagecreatefromstring(file_get_contents($filePath)); if ($image !== false) { $img = imagecreatetruecolor($imageWidth, $imageHeight); + imagealphablending($img, false); imagecopyresampled($img, $image, 0, 0, 0, 0, $imageWidth, $imageHeight, $imageWidth, $imageHeight); + imagesavealpha($img, true); + switch ($fileType) { case IMAGETYPE_GIF: + $transparencyIndex = imagecolortransparent($image); + if ($transparencyIndex >= 0) { + imagecolortransparent($img, $transparencyIndex); + for ($y = 0; $y < $imageHeight; ++$y) { + for ($x = 0; $x < $imageWidth; ++$x) { + if (((imagecolorat($img, $x, $y) >> 24) & 0x7F)) { + imagesetpixel($img, $x, $y, $transparencyIndex); + } + } + } + } + if (!imageistruecolor($image)) { + imagetruecolortopalette($img, false, imagecolorstotal($image)); + } imagegif($img, $filePath); break; case IMAGETYPE_JPEG: @@ -107,8 +124,9 @@ public function validate($filePath) imagepng($img, $filePath); break; default: - return; + break; } + imagedestroy($img); imagedestroy($image); return null; diff --git a/app/code/core/Mage/Core/etc/config.xml b/app/code/core/Mage/Core/etc/config.xml index 15114c5e59b..c0ee1a214f2 100644 --- a/app/code/core/Mage/Core/etc/config.xml +++ b/app/code/core/Mage/Core/etc/config.xml @@ -28,7 +28,7 @@ - 1.6.0.6 + 1.6.0.6.1.2 diff --git a/app/code/core/Mage/Core/etc/system.xml b/app/code/core/Mage/Core/etc/system.xml index 5dcd7b8e597..964a8068750 100644 --- a/app/code/core/Mage/Core/etc/system.xml +++ b/app/code/core/Mage/Core/etc/system.xml @@ -597,6 +597,27 @@ + text diff --git a/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.6.1.1-1.6.0.6.1.2.php b/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.6.1.1-1.6.0.6.1.2.php new file mode 100644 index 00000000000..c3a50a54340 --- /dev/null +++ b/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.6.1.1-1.6.0.6.1.2.php @@ -0,0 +1,40 @@ +startSetup(); +$connection = $installer->getConnection(); + +$connection->delete( + $this->getTable('core_config_data'), + $connection->prepareSqlCondition('path', array( + 'like' => 'dev/template/allow_symlink' + )) +); + +$installer->endSetup(); diff --git a/app/design/adminhtml/default/default/layout/main.xml b/app/design/adminhtml/default/default/layout/main.xml index 78ba06dc760..19d95fe24cb 100644 --- a/app/design/adminhtml/default/default/layout/main.xml +++ b/app/design/adminhtml/default/default/layout/main.xml @@ -119,8 +119,9 @@ Default layout, loads most of the pages - + + diff --git a/app/design/adminhtml/default/default/template/oauth/authorize/head-simple.phtml b/app/design/adminhtml/default/default/template/oauth/authorize/head-simple.phtml index 9ad6cdff318..348ffbf7ab7 100644 --- a/app/design/adminhtml/default/default/template/oauth/authorize/head-simple.phtml +++ b/app/design/adminhtml/default/default/template/oauth/authorize/head-simple.phtml @@ -42,7 +42,7 @@ var BLANK_URL = 'getJsUrl() ?>blank.html'; var BLANK_IMG = 'getJsUrl() ?>spacer.gif'; var BASE_URL = 'getUrl('*') ?>'; - var SKIN_URL = 'getSkinUrl() ?>'; + var SKIN_URL = 'jsQuoteEscape($this->getSkinUrl()) ?>'; var FORM_KEY = 'getFormKey() ?>'; //]]> diff --git a/app/design/frontend/base/default/template/checkout/multishipping/addresses.phtml b/app/design/frontend/base/default/template/checkout/multishipping/addresses.phtml index 272852ef2d1..9a0b59b9453 100644 --- a/app/design/frontend/base/default/template/checkout/multishipping/addresses.phtml +++ b/app/design/frontend/base/default/template/checkout/multishipping/addresses.phtml @@ -84,4 +84,5 @@ + getBlockHtml("formkey") ?> diff --git a/app/design/frontend/base/default/template/checkout/onepage/payment.phtml b/app/design/frontend/base/default/template/checkout/onepage/payment.phtml index d05c19a71d9..079996f5c18 100644 --- a/app/design/frontend/base/default/template/checkout/onepage/payment.phtml +++ b/app/design/frontend/base/default/template/checkout/onepage/payment.phtml @@ -36,8 +36,8 @@
getChildHtml('methods') ?> - getBlockHtml('formkey') ?>
+ getBlockHtml('formkey') ?>