Skip to content

Commit d1b86ae

Browse files
Merge pull request #1182 from magento-frontend/PR_08062017
Fixed issues: - MAGETWO-61189: Stored xss using svg images in Favicon - MAGETWO-54702: Failed ClearAllCompareProductsTest test due to Alert window. - MAGETWO-66885: Special Characters like % in widget inside of WYSIWYG gives an error #9452 - MAGETWO-59514: Hard coded "tax_region_id" in the \Magento\Tax\Setup\InstallData - MAGETWO-64952: Admin login does not handle autocomplete feature correctly
2 parents 519a65d + 8022747 commit d1b86ae

File tree

18 files changed

+119
-22
lines changed

18 files changed

+119
-22
lines changed

app/code/Magento/Backend/view/adminhtml/templates/admin/login.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
data-validate="{required:true}"
4444
value=""
4545
placeholder="<?php /* @escapeNotVerified */ echo __('password') ?>"
46-
autocomplete="off"
46+
autocomplete="new-password"
4747
/>
4848
</div>
4949
</div>

app/code/Magento/Backup/view/adminhtml/templates/backup/dialogs.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<fieldset class="admin__fieldset password-box-container">
7474
<div class="admin__field field _required">
7575
<label for="password" class="admin__field-label"><span><?php /* @escapeNotVerified */ echo __('User Password')?></span></label>
76-
<div class="admin__field-control"><input type="password" name="password" id="password" class="admin__control-text required-entry" autocomplete="off"></div>
76+
<div class="admin__field-control"><input type="password" name="password" id="password" class="admin__control-text required-entry" autocomplete="new-password"></div>
7777
</div>
7878

7979
<div class="admin__field field maintenance-checkbox-container">
@@ -119,7 +119,7 @@
119119
<span><?php /* @escapeNotVerified */ echo __('FTP Password') ?></span>
120120
</label>
121121
<div class="admin__field-control">
122-
<input type="password" class="admin__control-text" name="ftp_pass" id="ftp_pass" autocomplete="off">
122+
<input type="password" class="admin__control-text" name="ftp_pass" id="ftp_pass" autocomplete="new-password">
123123
</div>
124124
</div>
125125
<div class="admin__field field">

app/code/Magento/Catalog/view/adminhtml/ui_component/design_config_form.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<formElements>
2828
<fileUploader>
2929
<settings>
30-
<allowedExtensions>jpg jpeg gif png svg</allowedExtensions>
30+
<allowedExtensions>jpg jpeg gif png</allowedExtensions>
3131
<maxFileSize>2097152</maxFileSize>
3232
<uploaderConfig>
3333
<param xsi:type="string" name="url">theme/design_config_fileUploader/save</param>
@@ -87,7 +87,7 @@
8787
<formElements>
8888
<fileUploader>
8989
<settings>
90-
<allowedExtensions>jpg jpeg gif png svg</allowedExtensions>
90+
<allowedExtensions>jpg jpeg gif png</allowedExtensions>
9191
<maxFileSize>2097152</maxFileSize>
9292
<uploaderConfig>
9393
<param xsi:type="string" name="url">theme/design_config_fileUploader/save</param>
@@ -147,7 +147,7 @@
147147
<formElements>
148148
<fileUploader>
149149
<settings>
150-
<allowedExtensions>jpg jpeg gif png svg</allowedExtensions>
150+
<allowedExtensions>jpg jpeg gif png</allowedExtensions>
151151
<maxFileSize>2097152</maxFileSize>
152152
<uploaderConfig>
153153
<param xsi:type="string" name="url">theme/design_config_fileUploader/save</param>

app/code/Magento/Config/Model/Config/Backend/Image/Favicon.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ protected function _addWhetherScopeInfo()
4545
*/
4646
protected function _getAllowedExtensions()
4747
{
48-
return ['ico', 'png', 'gif', 'jpg', 'jpeg', 'apng', 'svg'];
48+
return ['ico', 'png', 'gif', 'jpg', 'jpeg', 'apng'];
4949
}
5050
}

app/code/Magento/Config/Model/Config/Backend/Image/Logo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ protected function _addWhetherScopeInfo()
4545
*/
4646
protected function _getAllowedExtensions()
4747
{
48-
return ['jpg', 'jpeg', 'gif', 'png', 'svg'];
48+
return ['jpg', 'jpeg', 'gif', 'png'];
4949
}
5050
}

app/code/Magento/Config/Test/Unit/Model/Config/Backend/Image/LogoTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function testBeforeSave()
7373
->will($this->returnValue('/tmp/val'));
7474
$this->uploaderMock->expects($this->once())
7575
->method('setAllowedExtensions')
76-
->with($this->equalTo(['jpg', 'jpeg', 'gif', 'png', 'svg']));
76+
->with($this->equalTo(['jpg', 'jpeg', 'gif', 'png']));
7777
$this->model->beforeSave();
7878
}
7979
}

app/code/Magento/Email/view/adminhtml/ui_component/design_config_form.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<formElements>
2323
<fileUploader>
2424
<settings>
25-
<allowedExtensions>jpg jpeg gif png svg</allowedExtensions>
25+
<allowedExtensions>jpg jpeg gif png</allowedExtensions>
2626
<maxFileSize>2097152</maxFileSize>
2727
<uploaderConfig>
2828
<param xsi:type="string" name="url">theme/design_config_fileUploader/save</param>

app/code/Magento/Swatches/view/adminhtml/ui_component/design_config_form.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<formElements>
2323
<fileUploader>
2424
<settings>
25-
<allowedExtensions>jpg jpeg gif png svg</allowedExtensions>
25+
<allowedExtensions>jpg jpeg gif png</allowedExtensions>
2626
<maxFileSize>2097152</maxFileSize>
2727
<uploaderConfig>
2828
<param xsi:type="string" name="url">theme/design_config_fileUploader/save</param>
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Tax\Setup;
8+
9+
use Magento\Directory\Model\RegionFactory;
10+
use Magento\Framework\Api\Search\SearchCriteriaFactory;
11+
use Magento\Framework\Setup\InstallDataInterface;
12+
use Magento\Framework\Setup\ModuleContextInterface;
13+
use Magento\Framework\Setup\ModuleDataSetupInterface;
14+
use Magento\Tax\Api\TaxRateRepositoryInterface;
15+
16+
/**
17+
* Update installed tax region codes
18+
*/
19+
class RecurringData implements InstallDataInterface
20+
{
21+
/**
22+
* Tax rate repository
23+
*
24+
* @var TaxRateRepositoryInterface
25+
*/
26+
private $taxRateRepository;
27+
28+
/**
29+
* @var SearchCriteriaFactory
30+
*/
31+
32+
private $searchCriteriaFactory;
33+
34+
/**
35+
* @var RegionFactory
36+
*/
37+
private $directoryRegionFactory;
38+
39+
/**
40+
* Init
41+
*
42+
* @param TaxRateRepositoryInterface $taxRateRepository
43+
* @param SearchCriteriaFactory $searchCriteriaFactory
44+
* @param RegionFactory $directoryRegionFactory
45+
*/
46+
public function __construct(
47+
TaxRateRepositoryInterface $taxRateRepository,
48+
SearchCriteriaFactory $searchCriteriaFactory,
49+
RegionFactory $directoryRegionFactory
50+
) {
51+
$this->taxRateRepository = $taxRateRepository;
52+
$this->searchCriteriaFactory = $searchCriteriaFactory;
53+
$this->directoryRegionFactory = $directoryRegionFactory;
54+
}
55+
56+
/**
57+
* {@inheritdoc}
58+
*/
59+
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
60+
{
61+
$taxRateList = $this->taxRateRepository->getList($this->searchCriteriaFactory->create());
62+
/** @var \Magento\Tax\Api\Data\TaxRateInterface $taxRateData */
63+
foreach ($taxRateList->getItems() as $taxRateData) {
64+
$regionCode = $this->parseRegionFromTaxCode($taxRateData->getCode());
65+
if ($regionCode) {
66+
/** @var \Magento\Directory\Model\Region $region */
67+
$region = $this->directoryRegionFactory->create();
68+
$region->loadByCode($regionCode, $taxRateData->getTaxCountryId());
69+
$taxRateData->setTaxRegionId($region->getRegionId());
70+
$this->taxRateRepository->save($taxRateData);
71+
}
72+
}
73+
}
74+
75+
/**
76+
* Parse region code from tax code
77+
*
78+
* @param string $taxCode
79+
* @return string
80+
*/
81+
private function parseRegionFromTaxCode($taxCode)
82+
{
83+
$result = '';
84+
$parts = explode('-', $taxCode, 3);
85+
86+
if (isset($parts[1])) {
87+
$result = $parts[1];
88+
}
89+
90+
return $result;
91+
}
92+
}

app/code/Magento/Theme/Model/Design/Backend/Favicon.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ protected function _addWhetherScopeInfo()
4343
*/
4444
public function getAllowedExtensions()
4545
{
46-
return ['ico', 'png', 'gif', 'jpg', 'jpeg', 'apng', 'svg'];
46+
return ['ico', 'png', 'gif', 'jpg', 'jpeg', 'apng'];
4747
}
4848
}

app/code/Magento/Theme/Model/Design/Backend/Logo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ protected function _addWhetherScopeInfo()
4141
*/
4242
public function getAllowedExtensions()
4343
{
44-
return ['jpg', 'jpeg', 'gif', 'png', 'svg'];
44+
return ['jpg', 'jpeg', 'gif', 'png'];
4545
}
4646
}

app/code/Magento/Theme/view/adminhtml/ui_component/design_config_form.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@
5656
</settings>
5757
<field name="head_shortcut_icon" formElement="fileUploader">
5858
<settings>
59-
<notice translate="true">Allowed file types: ico, png, gif, jpg, jpeg, apng, svg. Not all browsers support all these formats!</notice>
59+
<notice translate="true">Allowed file types: ico, png, gif, jpg, jpeg, apng. Not all browsers support all these formats!</notice>
6060
<label translate="true">Favicon Icon</label>
6161
<componentType>fileUploader</componentType>
6262
</settings>
6363
<formElements>
6464
<fileUploader>
6565
<settings>
66-
<allowedExtensions>jpg jpeg gif png svg ico apng</allowedExtensions>
66+
<allowedExtensions>jpg jpeg gif png ico apng</allowedExtensions>
6767
<maxFileSize>2097152</maxFileSize>
6868
<uploaderConfig>
6969
<param xsi:type="string" name="url">theme/design_config_fileUploader/save</param>
@@ -153,14 +153,14 @@
153153
</settings>
154154
<field name="header_logo_src" formElement="fileUploader">
155155
<settings>
156-
<notice translate="true">Allowed file types: png, gif, jpg, jpeg, svg.</notice>
156+
<notice translate="true">Allowed file types: png, gif, jpg, jpeg.</notice>
157157
<label translate="true">Logo Image</label>
158158
<componentType>fileUploader</componentType>
159159
</settings>
160160
<formElements>
161161
<fileUploader>
162162
<settings>
163-
<allowedExtensions>jpg jpeg gif png svg</allowedExtensions>
163+
<allowedExtensions>jpg jpeg gif png</allowedExtensions>
164164
<maxFileSize>2097152</maxFileSize>
165165
<uploaderConfig>
166166
<param xsi:type="string" name="url">theme/design_config_fileUploader/save</param>

dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ClearAllCompareProductsTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class ClearAllCompareProductsTest extends AbstractCompareProductsTest
2828
{
2929
/* tags */
3030
const MVP = 'yes';
31+
const TEST_TYPE = 'extended_acceptance_test';
3132
/* end tags */
3233

3334
/**

dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ClearAllCompareProductsTest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/variations.xsd">
99
<testCase name="Magento\Catalog\Test\TestCase\Product\ClearAllCompareProductsTest" summary="Clear All Compare Products" ticketId="MAGETWO-25961">
1010
<variation name="ClearAllCompareProductsTestVariation1">
11-
<data name="tag" xsi:type="string">stable:no</data>
1211
<data name="config/dataset" xsi:type="string">compare_products</data>
1312
<data name="products" xsi:type="string">catalogProductSimple::simple_for_composite_products,catalogProductVirtual::default,downloadableProduct::default,groupedProduct::grouped_product_with_price,configurableProduct::default,bundleProduct::bundle_dynamic_product,bundleProduct::bundle_fixed_product</data>
1413
<constraint name="Magento\Catalog\Test\Constraint\AssertProductCompareSuccessRemoveAllProductsMessage" />

lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,6 @@ define([
463463
var url = this.makeDirectiveUrl('%directive%').replace(/([$^.?*!+:=()\[\]{}|\\])/g, '\\$1'),
464464
reg = new RegExp(url.replace('%directive%', '([a-zA-Z0-9,_-]+)'));
465465

466-
content = decodeURIComponent(content);
467-
468466
return content.gsub(reg, function (match) { //eslint-disable-line no-extra-bind
469467
return Base64.mageDecode(match[1]);
470468
});

setup/view/magento/setup/marketplace-credentials.phtml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
</div>
2424
<form name="auth"
2525
role="form"
26+
autocomplete="off"
2627
ng-show="showCredsForm"
2728
>
2829
<fieldset class="fieldset">
@@ -63,6 +64,7 @@
6364
|| (auth.username.$error.required && user.submitted) }"
6465
autofocus
6566
required
67+
autocomplete="off"
6668
>
6769
<div class="error-container">
6870
This is a required field.
@@ -84,6 +86,7 @@
8486
&& !auth.password.$pristine)
8587
|| (auth.password.$error.required && user.submitted) }"
8688
required
89+
autocomplete="new-password"
8790
>
8891
<div class="error-container">
8992
This is a required field.

setup/view/magento/setup/popupauth.phtml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<form
3333
name="auth"
3434
role="form"
35+
autocomplete="off"
3536
>
3637
<fieldset class="fieldset">
3738
<legend ng-show="errors==false" class="legend">
@@ -62,6 +63,7 @@
6263
|| (auth.username.$error.required && user.submitted) }"
6364
autofocus
6465
required
66+
autocomplete="off"
6567
>
6668
<div class="error-container">
6769
This is a required field.
@@ -83,6 +85,7 @@
8385
&& !auth.password.$pristine)
8486
|| (auth.password.$error.required && user.submitted) }"
8587
required
88+
autocomplete="new-password"
8689
>
8790
<div class="error-container">
8891
This is a required field.

setup/view/magento/setup/system-config.phtml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
<h2 class="page-sub-title">Magento Marketplace</h2>
5858
<p>Sign in to sync your Magento Marketplace purchases.</p>
5959
<fieldset class="form-fieldset">
60-
<form ng-submit="saveAuthJson();" name="auth" role="form">
60+
<form ng-submit="saveAuthJson();" name="auth" role="form" autocomplete="off">
6161
<div class="row form-row">
6262
<div class="col-m-3">
6363
<label class="form-label required" for="username">Public Access Key</label>
@@ -74,6 +74,7 @@
7474
|| (auth.username.$error.required && user.submitted)}"
7575
autofocus
7676
required
77+
autocomplete="off"
7778
>
7879
<div class="error-container">
7980
This is a required field.
@@ -100,7 +101,7 @@
100101
ng-class="{ 'invalid' : (auth.password.$error.required && !auth.password.$pristine)
101102
|| (auth.password.$error.required && user.submitted) }"
102103
required
103-
autocomplete="off"
104+
autocomplete="new-password"
104105
>
105106
<div class="error-container">
106107
This is a required field.

0 commit comments

Comments
 (0)