Вопрос

I am trying to apply the newest patch for my Magento 1.7.0.2 installation, PATCH_SUPEE-7405_CE_1.7.0.2_v1-2016-01-20-04-58-44.sh

One hunk is failing in app/code/core/Mage/Core/Model/Email/Template/Filter.php because my file differs from what the patch expects. I checked against a fresh download of 1.7.0.2 and my file is the same. There is also an issue with missing file app/code/core/Zend/Xml/Security.php. There is an XmlRpc folder, but no Xml folder in the fresh 1.7.0.2 installation.

So, I expect I missed a previous patch on this file. But searching Google for magento patches affecting that file was not helpful. How can I find the previous patch I missed? Has anyone compiled a handy index of Magento patches vs the files they affect? That would be super useful.

EDIT:

I fixed Filter.php manually to make it match the pre-patch state for SUPEE-7405. But the patch is still failing because of the missing Xml folder.

EDIT 2:

I ended up reverting Filter.php. Patch 6788 was the one I was missing (thanks to answer below). After applying that patch, 7405 worked without any issues.

Here is my patch output (from before I fixed Filter.php:

user@example.com [~/public_html]# ./PATCH_SUPEE-7405_CE_1.7.0.2_v1-201
6-01-20-04-58-44.sh
Checking if patch can be applied/reverted successfully...
ERROR: Patch can't be applied/reverted successfully.

patching file app/code/core/Mage/Admin/Model/Observer.php
patching file app/code/core/Mage/Admin/Model/Redirectpolicy.php
patching file app/code/core/Mage/Admin/Model/Resource/User.php
patching file app/code/core/Mage/Admin/Model/Session.php
patching file app/code/core/Mage/Admin/Model/User.php
patching file app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.phpatching file app/code/core/Mage/Adminhtml/Block/Widget/Grid.php
patching file app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Edit/Action/Attribute.php
patching file app/code/core/Mage/Adminhtml/Helper/Sales.php
patching file app/code/core/Mage/Adminhtml/Model/System/Config/Backend/File.php
patching file app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image.php
patching file app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image/Favicon.php
patching file app/code/core/Mage/Adminhtml/controllers/IndexController.php
patching file app/code/core/Mage/Authorizenet/Helper/Admin.php
patching file app/code/core/Mage/Authorizenet/Helper/Data.php
patching file app/code/core/Mage/Authorizenet/controllers/Adminhtml/Authorizenet/Directpost/PaymentController.php
patching file app/code/core/Mage/Captcha/etc/config.xml
patching file app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Select.php
patching file app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Image.php
patching file app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Image.php
patching file app/code/core/Mage/CatalogIndex/etc/config.xml
patching file app/code/core/Mage/CatalogInventory/Helper/Minsaleqty.php
patching file app/code/core/Mage/Checkout/Block/Cart/Item/Renderer.php
patching file app/code/core/Mage/Checkout/controllers/CartController.php
patching file app/code/core/Mage/Checkout/controllers/OnepageController.php
patching file app/code/core/Mage/Core/Controller/Response/Http.php
patching file app/code/core/Mage/Core/Helper/Data.php
Hunk #1 succeeded at 883 (offset 6 lines).
patching file app/code/core/Mage/Core/Model/App.php
patching file app/code/core/Mage/Core/Model/Config.php
patching file app/code/core/Mage/Core/Model/Email/Template/Filter.php
Hunk #1 FAILED at 166.
Hunk #2 succeeded at 177 (offset -10 lines).
1 out of 2 hunks FAILED -- saving rejects to file app/code/core/Mage/Core/Model/Email/Template/Filter.php.rej
patching file app/code/core/Mage/Core/Model/Factory.php
patching file app/code/core/Mage/Core/Model/File/Validator/Image.php
patching file app/code/core/Mage/Core/Model/Input/Filter/MaliciousCode.php
patching file app/code/core/Mage/Core/Model/Session.php
patching file app/code/core/Mage/Customer/controllers/AccountController.php
Hunk #1 succeeded at 65 (offset -3 lines).
patching file app/code/core/Mage/Dataflow/Model/Convert/Parser/Csv.php
patching file app/code/core/Mage/Downloadable/controllers/CustomerController.php
patching file app/code/core/Mage/ImportExport/Model/Export/Adapter/Abstract.php
patching file app/code/core/Mage/ImportExport/Model/Export/Adapter/Csv.php
patching file app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php
patching file app/code/core/Mage/ImportExport/etc/config.xml
patching file app/code/core/Mage/ImportExport/etc/system.xml
patching file app/code/core/Mage/Newsletter/Model/Observer.php
patching file app/code/core/Mage/Newsletter/Model/Queue.php
patching file app/code/core/Mage/Page/etc/system.xml
patching file app/code/core/Mage/Paypal/controllers/PayflowController.php
patching file app/code/core/Mage/Paypal/controllers/PayflowadvancedController.ph
patching file app/code/core/Mage/Paypal/etc/config.xml
patching file app/code/core/Mage/Persistent/etc/config.xml
patching file app/code/core/Mage/Review/controllers/ProductController.php
patching file app/code/core/Mage/Rss/Block/Catalog/Salesrule.php
patching file app/code/core/Mage/Sales/Helper/Guest.php
patching file app/code/core/Mage/Sales/Model/Quote/Address.php
patching file app/code/core/Mage/Sales/Model/Quote/Item.php
can't find file to patch at input line 2293
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git app/code/core/Zend/Xml/Security.php app/code/core/Zend/Xml/Security.php
|index a3cdbc8..8b697b9 100644
|--- app/code/core/Zend/Xml/Security.php
|+++ app/code/core/Zend/Xml/Security.php
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
3 out of 3 hunks ignored
patching file app/design/adminhtml/default/default/template/authorizenet/directpost/iframe.phtml
patching file app/design/adminhtml/default/default/template/bundle/sales/creditmemo/create/items/renderer.phtml
patching file app/design/adminhtml/default/default/template/bundle/sales/creditmemo/view/items/renderer.phtml
patching file app/design/adminhtml/default/default/template/bundle/sales/invoice/create/items/renderer.phtml
patching file app/design/adminhtml/default/default/template/bundle/sales/invoice/view/items/renderer.phtml
patching file app/design/adminhtml/default/default/template/bundle/sales/order/view/items/renderer.phtml
patching file app/design/adminhtml/default/default/template/bundle/sales/shipment/create/items/renderer.phtml
patching file app/design/adminhtml/default/default/template/bundle/sales/shipment/view/items/renderer.phtml
patching file app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/file.phtml
patching file app/design/adminhtml/default/default/template/downloadable/sales/items/column/downloadable/creditmemo/name.phtml
patching file app/design/adminhtml/default/default/template/downloadable/sales/items/column/downloadable/invoice/name.phtml
patching file app/design/adminhtml/default/default/template/downloadable/sales/items/column/downloadable/name.phtml
patching file app/design/adminhtml/default/default/template/sales/items/column/name.phtml
patching file app/design/adminhtml/default/default/template/sales/items/renderer/default.phtml
patching file app/design/adminhtml/default/default/template/sales/order/totals/discount.phtml
patching file app/design/adminhtml/default/default/template/sales/order/view/info.phtml
patching file app/design/frontend/base/default/template/catalog/product/view/options/type/file.phtml
patching file app/design/frontend/base/default/template/rss/order/details.phtml
patching file lib/Varien/File/Uploader.php
patching file lib/Varien/Io/File.php
user@example.com [~/public_html]# exit
Это было полезно?

Решение

The easiest way to find out what files are affected in a patch is to take a programmer's text editor like TextPad, sort the lines in the patch and extract all the +++ app/ +++ lib/ and other obvious file path names. A sampling of SUPEE-7405 as follows:

+++ app/code/core/Mage/Admin/Model/Observer.php
+++ app/code/core/Mage/Admin/Model/Redirectpolicy.php
+++ app/code/core/Mage/Admin/Model/Resource/User.php
~SNIP~
+++ app/design/frontend/base/default/template/rss/order/details.phtml
+++ lib/Varien/File/Uploader.php
+++ lib/Varien/Io/File.php

Another is to have somebody with a successful patch chain give you the instances where the items were patched.

SUPEE-6788
patching file app/code/core/Mage/Core/Model/Email/Template/Filter.php

SUPEE-7405
patching file app/code/core/Mage/Core/Model/Email/Template/Filter.php

SUPEE-6788
patching file app/code/core/Zend/Xml/Security.php

SUPEE-7405
patching file app/code/core/Zend/Xml/Security.php

I think you are looking for SUPEE-6788 as it incuded

+++ .htaccess
+++ .htaccess.sample
+++ app/code/core/Mage/Admin/Model/Block.php
+++ app/code/core/Mage/Admin/Model/Resource/Block.php
+++ app/code/core/Mage/Admin/Model/Resource/Block/Collection.php
+++ app/code/core/Mage/Admin/Model/Resource/Variable.php
+++ app/code/core/Mage/Admin/Model/Resource/Variable/Collection.php
+++ app/code/core/Mage/Admin/Model/Variable.php
+++ app/code/core/Mage/Admin/etc/config.xml
+++ app/code/core/Mage/Admin/sql/admin_setup/upgrade-1.6.1.0-1.6.1.1.php
+++ app/code/core/Mage/Admin/sql/admin_setup/upgrade-1.6.1.1-1.6.1.2.php
+++ app/code/core/Mage/Adminhtml/Block/Permissions/Block.php
+++ app/code/core/Mage/Adminhtml/Block/Permissions/Block/Edit.php
+++ app/code/core/Mage/Adminhtml/Block/Permissions/Block/Edit/Form.php
+++ app/code/core/Mage/Adminhtml/Block/Permissions/Block/Grid.php
+++ app/code/core/Mage/Adminhtml/Block/Permissions/Variable.php
+++ app/code/core/Mage/Adminhtml/Block/Permissions/Variable/Edit.php
+++ app/code/core/Mage/Adminhtml/Block/Permissions/Variable/Edit/Form.php
+++ app/code/core/Mage/Adminhtml/Block/Permissions/Variable/Grid.php
+++ app/code/core/Mage/Adminhtml/controllers/Permissions/BlockController.php
+++ app/code/core/Mage/Adminhtml/controllers/Permissions/VariableController.php
+++ app/code/core/Mage/Adminhtml/etc/adminhtml.xml
+++ app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php
+++ app/code/core/Mage/Core/Controller/Request/Http.php
+++ app/code/core/Mage/Core/Controller/Varien/Router/Admin.php
+++ app/code/core/Mage/Core/Helper/UnserializeArray.php
+++ app/code/core/Mage/Core/Model/Email/Template/Filter.php
+++ app/code/core/Mage/Core/Model/Resource/Setup.php
+++ app/code/core/Mage/Core/etc/config.xml
+++ app/code/core/Mage/Core/etc/system.xml
+++ app/code/core/Mage/Customer/Block/Account/Changeforgotten.php
+++ app/code/core/Mage/Customer/Block/Account/Resetpassword.php
+++ app/code/core/Mage/Customer/controllers/AccountController.php
+++ app/code/core/Mage/Downloadable/Model/Product/Type.php
+++ app/code/core/Mage/Eav/Model/Resource/Attribute/Collection.php
+++ app/code/core/Mage/Sales/Model/Resource/Order/Item/Collection.php
+++ app/code/core/Mage/Sales/controllers/DownloadController.php
+++ app/code/core/Mage/SalesRule/Model/Resource/Coupon/Collection.php
+++ app/code/core/Zend/Soap/Server.php
+++ app/code/core/Zend/Xml/Exception.php
+++ app/code/core/Zend/Xml/Security.php
+++ app/code/core/Zend/XmlRpc/Request.php
+++ app/code/core/Zend/XmlRpc/Response.php
+++ app/design/adminhtml/default/default/layout/admin.xml
+++ app/design/frontend/base/default/layout/customer.xml
+++ app/design/frontend/base/default/template/customer/form/register.phtml
+++ app/design/frontend/base/default/template/customer/form/resetforgottenpassword.phtml
+++ app/design/frontend/base/default/template/page/js/cookie.phtml
+++ app/design/frontend/base/default/template/persistent/customer/form/register.phtml
+++ app/design/frontend/default/iphone/layout/customer.xml
+++ app/design/frontend/default/modern/layout/customer.xml
+++ errors/processor.php
+++ lib/Unserialize/Parser.php
+++ lib/Unserialize/Reader/Arr.php
+++ lib/Unserialize/Reader/ArrKey.php
+++ lib/Unserialize/Reader/ArrValue.php
+++ lib/Unserialize/Reader/Bool.php
+++ lib/Unserialize/Reader/Dbl.php
+++ lib/Unserialize/Reader/Int.php
+++ lib/Unserialize/Reader/Str.php
+++ lib/Varien/Data/Collection/Db.php

Другие советы

obviously correct answer is to use magento repository to filter for patches and search for affected files:

curl -k https://MAGEID:TOKEN@www.magentocommerce.com/products/downloads/info/help

with some little bash-fu you can do this in 5-10 minutes...

but

as magento dont really cares about security, releasing software as-is (cause marketing is the first priority for this company, then they just pay for bug-hunting)

so there are only few people knew about this repository, and even if you get access to - there is no easy to browse and work with it...

there are no any logical explanation why all these files are not available in a simple accessible form...

Лицензировано под: CC-BY-SA с атрибуция
Не связан с magento.stackexchange
scroll top