1

I try to apply the new patch from 1.9.3.2 to 1.9.3.6 and I get this answer. Any help? Thank you.

sh PATCH_SUPEE-10266_CE_1.9.3.2_v1-2017-09-13-06-38-58.sh
Checking if patch can be applied/reverted successfully...
ERROR: Patch can't be applied/reverted successfully.

    checking file app/code/core/Mage/Admin/Model/Session.php
    checking file app/code/core/Mage/Adminhtml/Block/Notification/Grid/Renderer/Notice.php
    checking file app/code/core/Mage/Adminhtml/Block/Widget/Form/Container.php
    checking file app/code/core/Mage/Adminhtml/Controller/Action.php
    checking file app/code/core/Mage/Adminhtml/Model/LayoutUpdate/Validator.php
    checking file app/code/core/Mage/Adminhtml/controllers/CustomerController.php
    checking file app/code/core/Mage/Adminhtml/controllers/Newsletter/QueueController.php
    checking file app/code/core/Mage/Adminhtml/controllers/Newsletter/TemplateController.php
    checking file app/code/core/Mage/Checkout/controllers/CartController.php
    checking file app/code/core/Mage/Core/Model/Email/Template/Abstract.php
    checking file app/code/core/Mage/Core/Model/File/Validator/Image.php

**Hunk #1 FAILED at 91.
1 out of 1 hunk FAILED**

    checking file app/code/core/Mage/Core/Model/Session/Abstract/Varien.php
    checking file app/code/core/Mage/Core/etc/config.xml
    checking file app/code/core/Mage/Rss/Helper/Data.php
    checking file app/code/core/Mage/Sales/Model/Resource/Order/Item/Collection.php
    checking file app/code/core/Zend/Serializer/Adapter/PhpCode.php
    checking file app/design/adminhtml/default/default/template/backup/dialogs.phtml
    checking file app/design/adminhtml/default/default/template/catalog/product/edit/options/type/file.phtml
    checking file app/design/adminhtml/default/default/template/customer/tab/view.phtml
    checking file app/design/adminhtml/default/default/template/login.phtml
    checking file app/design/adminhtml/default/default/template/notification/toolbar.phtml
    checking file app/design/adminhtml/default/default/template/oauth/authorize/form/login-simple.phtml
    checking file app/design/adminhtml/default/default/template/oauth/authorize/form/login.phtml
    checking file app/design/adminhtml/default/default/template/resetforgottenpassword.phtml
    checking file app/design/adminhtml/default/default/template/sales/order/view/history.phtml
    checking file app/design/adminhtml/default/default/template/sales/order/view/info.phtml
    checking file app/design/install/default/default/template/install/create_admin.phtml
    checking file app/locale/en_US/Mage_Adminhtml.csv
    can't find file to patch at input line 720
    Perhaps you used the wrong -p or --strip option?

The text leading up to this was:
--------------------------
|diff --git downloader/template/login.phtml downloader/template/login.phtml
|index 26a7b84..a846d60 100644
|--- downloader/template/login.phtml
|+++ downloader/template/login.phtml
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
1 out of 1 hunk ignored
  • check downloader/template/login.phtml file was mssied please check. app/code/core/Mage/Core/Model/File/Validator/Image.php check and confirm any before file missed – Rama Chandran M Sep 18 '17 at 16:58
  • @Espai Is your issue solved? – zus Dec 5 '17 at 6:27
2

Have a look at this answer:

We at [MageHost.pro][1] found a problem in the patch for Magento 1.9.1.1, patch file PATCH_SUPEE-10266_CE_1.9.1.1_v1-2017-09-15-04-59-56.sh

Error:

checking file app/code/core/Mage/Core/Model/File/Validator/Image.php
Hunk #1 FAILED at 90.
1 out of 1 hunk FAILED

I fixed it by replacing lines 454-472 by 454-471 from PATCH_SUPEE-10266_CE_1.9.1.0_v1-2017-09-13-06-34-33.sh

Old code, line 454-472:

diff --git app/code/core/Mage/Core/Model/File/Validator/Image.php app/code/core/Mage/Core/Model/File/Validator/Image.php
index 7f7b9d0..8a28da2 100644
   --- app/code/core/Mage/Core/Model/File/Validator/Image.php
   +++ app/code/core/Mage/Core/Model/File/Validator/Image.php
   @@ -90,7 +90,13 @@ class Mage_Core_Model_File_Validator_Image
            $fileInfo = getimagesize($filePath);
        if (is_array($fileInfo) and isset($fileInfo[2])) {
            if ($this->isImageType($fileInfo[2])) {
-                return null;
+                /**
+                 * if 'general/reprocess_images/active' false then skip image reprocessing.
+                 * NOTE: If you turn off images reprocessing, then your upload images process may cause security risks.
+                 */
+                if (!Mage::getStoreConfigFlag('general/reprocess_images/active')) {
+                    return null;
+                }
             }
         }
         throw Mage::exception('Mage_Core', Mage::helper('core')->__('Invalid MIME type.'));

New code, lines 454-471:

diff --git app/code/core/Mage/Core/Model/File/Validator/Image.php app/code/core/Mage/Core/Model/File/Validator/Image.php
index 8618bca..d3aba19 100644
--- app/code/core/Mage/Core/Model/File/Validator/Image.php
+++ app/code/core/Mage/Core/Model/File/Validator/Image.php
@@ -90,6 +90,13 @@ class Mage_Core_Model_File_Validator_Image
        list($imageWidth, $imageHeight, $fileType) = getimagesize($filePath);
        if ($fileType) {
            if ($this->isImageType($fileType)) {
+                /**
+                 * if 'general/reprocess_images/active' false then skip image reprocessing.
+                 * NOTE: If you turn off images reprocessing, then your upload images process may cause security risks.
+                 */
+                if (!Mage::getStoreConfigFlag('general/reprocess_images/active')) {
+                    return null;
+                }
                 //replace tmp image with re-sampled copy to exclude images with malicious data
                 $image = imagecreatefromstring(file_get_contents($filePath));
                 if ($image !== false) {

[1]: https://magehost.pro

  • No light to me. Thank you, anyway, James. – Espai Sep 18 '17 at 20:01
  • I had this same issue in 1.9.2.1 without Patch 9767 v2 applied. Make sure you have that one applied, if that still doesn't work. Copy the file from a fresh Magento 1.9.3.4 installation and re-apply the patch. – Daan van den Bergh Sep 25 '17 at 12:59
1

Only do this if you are sure that you have all previous patches applied!

What I did, is download a fresh Magento 1.9.3.4 install and copy the /app/code/core/Mage/Core/Model/File/Validator/Image.php from there into my Magento install and ran the patch again. It immediately was applied succesfully.

Note: Afterwards it appeared that patch 9767 v2 wasn't correctly applied. So I re-applied it and immediately could succesfully apply this patch.

Note #2: While trying to install Patch SUPEE 10497 for Magento 1.9.1.1 I ran into the same issue. Just wanted to confirm that the same fix can be applied here.

0

It is because the PATCH is expecting the password input in the login.phtml template file to have a autocomplete="off" parameter.

To fix this, open up your /downloader/template/login.phtml and replace this line:

<tr><td class="label"><label for="password">Password:</label></td><td class="value"><input type="password" id="password" name="password"/></td></tr>

with this line:

<tr><td class="label"><label for="password">Password:</label></td><td class="value"><input type="password" id="password" name="password" autocomplete="off"/></td></tr>

Now try running your patch again.

Not the answer you're looking for? Browse other questions tagged or ask your own question.