Skip to content

Commit 1c623c8

Browse files
committed
Merge remote-tracking branch 'origin/badgers-pr' into badgers-pr
2 parents 1d4c276 + 867aa3a commit 1c623c8

File tree

12 files changed

+59
-39
lines changed

12 files changed

+59
-39
lines changed

app/code/Magento/Authorizenet/etc/adminhtml/system.xml

+2
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,11 @@
8585
</field>
8686
<field id="min_order_total" translate="label" type="text" sortOrder="190" showInDefault="1" showInWebsite="1" showInStore="0">
8787
<label>Minimum Order Total</label>
88+
<validate>validate-number validate-zero-or-greater</validate>
8889
</field>
8990
<field id="max_order_total" translate="label" type="text" sortOrder="200" showInDefault="1" showInWebsite="1" showInStore="0">
9091
<label>Maximum Order Total</label>
92+
<validate>validate-number validate-zero-or-greater</validate>
9193
</field>
9294
<field id="sort_order" translate="label" type="text" sortOrder="210" showInDefault="1" showInWebsite="1" showInStore="0">
9395
<label>Sort Order</label>

app/code/Magento/AuthorizenetAcceptjs/etc/adminhtml/system.xml

+2
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,12 @@
101101
<field id="min_order_total" translate="label" type="text" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="0">
102102
<label>Minimum Order Total</label>
103103
<config_path>payment/authorizenet_acceptjs/min_order_total</config_path>
104+
<validate>validate-number validate-zero-or-greater</validate>
104105
</field>
105106
<field id="max_order_total" translate="label" type="text" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="0">
106107
<label>Maximum Order Total</label>
107108
<config_path>payment/authorizenet_acceptjs/max_order_total</config_path>
109+
<validate>validate-number validate-zero-or-greater</validate>
108110
</field>
109111
<field id="sort_order" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0">
110112
<label>Sort Order</label>

app/code/Magento/Bundle/Setup/Patch/Data/ApplyAttributesUpdate.php

+13-14
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
use Magento\Eav\Setup\EavSetupFactory;
1515

1616
/**
17-
* Class ApplyAttributesUpdate
18-
* @package Magento\Bundle\Setup\Patch
17+
* Class \Magento\Bundle\Setup\Patch\ApplyAttributesUpdate
1918
*/
2019
class ApplyAttributesUpdate implements DataPatchInterface, PatchVersionInterface
2120
{
@@ -44,7 +43,7 @@ public function __construct(
4443
}
4544

4645
/**
47-
* {@inheritdoc}
46+
* @inheritdoc
4847
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
4948
*/
5049
public function apply()
@@ -66,8 +65,8 @@ public function apply()
6665
',',
6766
$eavSetup->getAttribute(\Magento\Catalog\Model\Product::ENTITY, $field, 'apply_to')
6867
);
69-
if (!in_array('bundle', $applyTo)) {
70-
$applyTo[] = 'bundle';
68+
if (!in_array(\Magento\Catalog\Model\Product\Type::TYPE_BUNDLE, $applyTo)) {
69+
$applyTo[] = \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE;
7170
$eavSetup->updateAttribute(
7271
\Magento\Catalog\Model\Product::ENTITY,
7372
$field,
@@ -78,7 +77,7 @@ public function apply()
7877
}
7978

8079
$applyTo = explode(',', $eavSetup->getAttribute(\Magento\Catalog\Model\Product::ENTITY, 'cost', 'apply_to'));
81-
unset($applyTo[array_search('bundle', $applyTo)]);
80+
unset($applyTo[array_search(\Magento\Catalog\Model\Product\Type::TYPE_BUNDLE, $applyTo)]);
8281
$eavSetup->updateAttribute(\Magento\Catalog\Model\Product::ENTITY, 'cost', 'apply_to', implode(',', $applyTo));
8382

8483
/**
@@ -106,7 +105,7 @@ public function apply()
106105
'visible_on_front' => false,
107106
'used_in_product_listing' => true,
108107
'unique' => false,
109-
'apply_to' => 'bundle'
108+
'apply_to' => \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE
110109
]
111110
);
112111

@@ -131,7 +130,7 @@ public function apply()
131130
'comparable' => false,
132131
'visible_on_front' => false,
133132
'unique' => false,
134-
'apply_to' => 'bundle'
133+
'apply_to' => \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE
135134
]
136135
);
137136

@@ -157,7 +156,7 @@ public function apply()
157156
'visible_on_front' => false,
158157
'used_in_product_listing' => true,
159158
'unique' => false,
160-
'apply_to' => 'bundle'
159+
'apply_to' => \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE
161160
]
162161
);
163162

@@ -184,7 +183,7 @@ public function apply()
184183
'visible_on_front' => false,
185184
'used_in_product_listing' => true,
186185
'unique' => false,
187-
'apply_to' => 'bundle'
186+
'apply_to' => \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE
188187
]
189188
);
190189

@@ -210,29 +209,29 @@ public function apply()
210209
'visible_on_front' => false,
211210
'used_in_product_listing' => true,
212211
'unique' => false,
213-
'apply_to' => 'bundle'
212+
'apply_to' => \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE
214213
]
215214
);
216215
}
217216

218217
/**
219-
* {@inheritdoc}
218+
* @inheritdoc
220219
*/
221220
public static function getDependencies()
222221
{
223222
return [];
224223
}
225224

226225
/**
227-
* {@inheritdoc}
226+
* @inheritdoc
228227
*/
229228
public static function getVersion()
230229
{
231230
return '2.0.0';
232231
}
233232

234233
/**
235-
* {@inheritdoc}
234+
* @inheritdoc
236235
*/
237236
public function getAliases()
238237
{

app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/modal-configurable.js

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ define([
3434
}
3535

3636
this._super();
37+
} else {
38+
this.form().focusInvalid();
3739
}
3840
}
3941
});

app/code/Magento/OfflinePayments/etc/adminhtml/system.xml

+10
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@
4242
</field>
4343
<field id="min_order_total" translate="label" type="text" sortOrder="98" showInDefault="1" showInWebsite="1" showInStore="0">
4444
<label>Minimum Order Total</label>
45+
<validate>validate-number validate-zero-or-greater</validate>
4546
</field>
4647
<field id="max_order_total" translate="label" type="text" sortOrder="99" showInDefault="1" showInWebsite="1" showInStore="0">
4748
<label>Maximum Order Total</label>
49+
<validate>validate-number validate-zero-or-greater</validate>
4850
</field>
4951
<field id="model"></field>
5052
</group>
@@ -76,9 +78,11 @@
7678
</field>
7779
<field id="min_order_total" translate="label" type="text" sortOrder="98" showInDefault="1" showInWebsite="1" showInStore="0">
7880
<label>Minimum Order Total</label>
81+
<validate>validate-number validate-zero-or-greater</validate>
7982
</field>
8083
<field id="max_order_total" translate="label" type="text" sortOrder="99" showInDefault="1" showInWebsite="1" showInStore="0">
8184
<label>Maximum Order Total</label>
85+
<validate>validate-number validate-zero-or-greater</validate>
8286
</field>
8387
<field id="model"></field>
8488
</group>
@@ -109,12 +113,15 @@
109113
</field>
110114
<field id="min_order_total" translate="label" type="text" sortOrder="98" showInDefault="1" showInWebsite="1" showInStore="0">
111115
<label>Minimum Order Total</label>
116+
<validate>validate-number validate-zero-or-greater</validate>
112117
</field>
113118
<field id="max_order_total" translate="label" type="text" sortOrder="99" showInDefault="1" showInWebsite="1" showInStore="0">
114119
<label>Maximum Order Total</label>
120+
<validate>validate-number validate-zero-or-greater</validate>
115121
</field>
116122
<field id="sort_order" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0">
117123
<label>Sort Order</label>
124+
<validate>validate-number</validate>
118125
</field>
119126
</group>
120127
<group id="cashondelivery" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
@@ -144,12 +151,15 @@
144151
</field>
145152
<field id="min_order_total" translate="label" type="text" sortOrder="98" showInDefault="1" showInWebsite="1" showInStore="0">
146153
<label>Minimum Order Total</label>
154+
<validate>validate-number validate-zero-or-greater</validate>
147155
</field>
148156
<field id="max_order_total" translate="label" type="text" sortOrder="99" showInDefault="1" showInWebsite="1" showInStore="0">
149157
<label>Maximum Order Total</label>
158+
<validate>validate-number validate-zero-or-greater</validate>
150159
</field>
151160
<field id="sort_order" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0">
152161
<label>Sort Order</label>
162+
<validate>validate-number</validate>
153163
</field>
154164
</group>
155165
</section>

app/code/Magento/PageCache/Model/Config.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -214,18 +214,18 @@ protected function _getReplacements()
214214
*/
215215
protected function _getAccessList()
216216
{
217-
$result = '';
218-
$tpl = " \"%s\";";
217+
$tpl = ' "%s";';
219218
$accessList = $this->_scopeConfig->getValue(self::XML_VARNISH_PAGECACHE_ACCESS_LIST);
220219
if (!empty($accessList)) {
221-
$result = [];
220+
$ipsList = [];
222221
$ips = explode(',', $accessList);
223222
foreach ($ips as $ip) {
224-
$result[] = sprintf($tpl, trim($ip));
223+
$ipsList[] = sprintf($tpl, trim($ip));
225224
}
226-
return implode("\n", $result);
225+
return implode("\n", $ipsList);
227226
}
228-
return $result;
227+
228+
return '';
229229
}
230230

231231
/**

app/code/Magento/Reports/Controller/Adminhtml/Report/Product/Downloads.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
<?php
22
/**
3-
*
43
* Copyright © Magento, Inc. All rights reserved.
54
* See COPYING.txt for license details.
65
*/
6+
declare(strict_types=1);
7+
78
namespace Magento\Reports\Controller\Adminhtml\Report\Product;
89

910
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
1011

12+
/**
13+
* Class \Magento\Reports\Controller\Adminhtml\Report\Product\Downloads
14+
*/
1115
class Downloads extends \Magento\Reports\Controller\Adminhtml\Report\Product implements HttpGetActionInterface
1216
{
1317
/**
1418
* Authorization level of a basic admin session
1519
*
1620
* @see _isAllowed()
1721
*/
18-
const ADMIN_RESOURCE = 'Magento_Reports::report_products';
22+
const ADMIN_RESOURCE = 'Magento_Reports::downloads';
1923

2024
/**
2125
* Downloads action

app/code/Magento/Sales/Model/Order/Email/SenderBuilder.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,9 @@ public function sendCopyTo()
8585
$copyTo = $this->identityContainer->getEmailCopyTo();
8686

8787
if (!empty($copyTo) && $this->identityContainer->getCopyMethod() == 'copy') {
88+
$this->configureEmailTemplate();
8889
foreach ($copyTo as $email) {
89-
$this->configureEmailTemplate();
90-
9190
$this->transportBuilder->addTo($email);
92-
9391
$transport = $this->transportBuilder->getTransport();
9492
$transport->sendMessage();
9593
}

app/code/Magento/Wishlist/view/frontend/templates/item/column/cart.phtml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ $allowedQty = $viewModel->setItem($item)->getMinMaxQty();
2323
<label class="label" for="qty[<?= $block->escapeHtmlAttr($item->getId()) ?>]"><span><?= $block->escapeHtml(__('Qty')) ?></span></label>
2424
<div class="control">
2525
<input type="number" data-role="qty" id="qty[<?= $block->escapeHtmlAttr($item->getId()) ?>]" class="input-text qty" data-validate="{'required-number':true,'validate-greater-than-zero':true, 'validate-item-quantity':{'minAllowed':<?= /* @noEscape */ $allowedQty['minAllowed'] ?>,'maxAllowed':<?= /* @noEscape */ $allowedQty['maxAllowed'] ?>}}"
26-
name="qty[<?= $block->escapeHtmlAttr($item->getId()) ?>]" value="<?= /* @noEscape */ (int)($block->getAddToCartQty($item) * 1) ?>" <?= $product->isSaleable() ? '' : 'disabled="disabled"' ?>>
26+
name="qty[<?= $block->escapeHtmlAttr($item->getId()) ?>]" value="<?= /* @noEscape */ $block->getAddToCartQty($item) * 1 ?>" <?= $product->isSaleable() ? '' : 'disabled="disabled"' ?>>
2727
</div>
2828
</div>
2929
<?php endif; ?>

lib/internal/Magento/Framework/Api/ImageContentValidator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ protected function isMimeTypeValid($mimeType)
8686
*/
8787
protected function isNameValid($name)
8888
{
89-
// Cannot contain \ / : * ? " < > |
89+
// Cannot contain \ / ? * : " ; < > ( ) | { }
9090
if (!preg_match('/^[^\\/?*:";<>()|{}\\\\]+$/', $name)) {
9191
return false;
9292
}

lib/internal/Magento/Framework/Encryption/Encryptor.php

+13-10
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public function __construct(
162162
*/
163163
public function getLatestHashVersion(): int
164164
{
165-
if (extension_loaded('sodium')) {
165+
if (extension_loaded('sodium') && defined('SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13')) {
166166
return self::HASH_VERSION_ARGON2ID13;
167167
}
168168

@@ -314,8 +314,8 @@ public function validateHashVersion($hash, $validateCount = false)
314314
* Explode password hash
315315
*
316316
* @param string $hash
317-
* @throws \RuntimeException When given hash cannot be processed.
318317
* @return array
318+
* @throws \RuntimeException When given hash cannot be processed.
319319
*/
320320
private function explodePasswordHash($hash)
321321
{
@@ -398,6 +398,7 @@ public function encryptWithFastestAvailableAlgorithm($data)
398398
':' . $this->getCipherVersion() .
399399
':' . base64_encode($crypt->encrypt($data));
400400
}
401+
401402
/**
402403
* Look for key and crypt versions in encrypted data before decrypting
403404
*
@@ -579,13 +580,15 @@ private function getArgonHash($data, $salt = ''): string
579580
$salt = str_pad($salt, SODIUM_CRYPTO_PWHASH_SALTBYTES, $salt);
580581
}
581582

582-
return bin2hex(sodium_crypto_pwhash(
583-
SODIUM_CRYPTO_SIGN_SEEDBYTES,
584-
$data,
585-
$salt,
586-
SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE,
587-
SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE,
588-
$this->hashVersionMap[self::HASH_VERSION_ARGON2ID13]
589-
));
583+
return bin2hex(
584+
sodium_crypto_pwhash(
585+
SODIUM_CRYPTO_SIGN_SEEDBYTES,
586+
$data,
587+
$salt,
588+
SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE,
589+
SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE,
590+
$this->hashVersionMap[self::HASH_VERSION_ARGON2ID13]
591+
)
592+
);
590593
}
591594
}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -659,9 +659,9 @@ define([
659659

660660
// process tag attributes string
661661
attributesString = attributesString.gsub(/([a-z0-9\-\_]+)="(.*?)(\{\{.+?\}\})(.*?)"/i, function (m) {
662-
decodedDirectiveString = encodeURIComponent(Base64.mageEncode(m[3].replace(/&quot;/g, '"')));
662+
decodedDirectiveString = encodeURIComponent(Base64.mageEncode(m[3].replace(/&quot;/g, '"') + m[4]));
663663

664-
return m[1] + '="' + m[2] + this.makeDirectiveUrl(decodedDirectiveString) + m[4] + '"';
664+
return m[1] + '="' + m[2] + this.makeDirectiveUrl(decodedDirectiveString) + '"';
665665
}.bind(this));
666666

667667
return '<' + match[1] + attributesString + '>';

0 commit comments

Comments
 (0)