Skip to content

Commit f45fe09

Browse files
authored
Merge pull request magento#6936 from magento-commerce/platform-health
[Platform Health Community Project] Removed lamias-crypt, reflection methods and jquery upgrade preparation
2 parents 0a05fa3 + 6d705cb commit f45fe09

File tree

27 files changed

+50
-99
lines changed

27 files changed

+50
-99
lines changed

app/code/Magento/Backend/view/adminhtml/web/template/dynamic-rows/grid.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<div class="admin__control-table-pagination" visible="!!element.getRecordCount()">
3838
<div class="admin__data-grid-pager">
3939
<button class="action-previous" type="button" data-bind="attr: {title: $t('Previous Page')}, click: previousPage, disable: isFirst()"></button>
40-
<input class="admin__control-text" type="number" data-bind="attr: {id: ++ko.uid}, value: currentPage">
40+
<input class="admin__control-text" type="number" data-bind="attr: {id: ++ko.uid}, value: currentPage"/>
4141
<label class="admin__control-support-text" data-bind="attr: {for: ko.uid}, text: 'of ' + pages()"></label>
4242
<button class="action-next" type="button" data-bind="attr: {title: $t('Next Page')}, click: nextPage, disable: isLast()"></button>
4343
</div>
@@ -86,7 +86,7 @@
8686
<div class="message message-notice notice">
8787
<span
8888
translate="'Search strings are either normal strings or regular expressions (PCRE). They are matched in the same order as entered.'"></span>
89-
<br>
89+
<br/>
9090
<span
9191
translate="'Examples'"></span>:
9292
<span class="code-sample">Firefox: /^mozilla/i</span>

app/code/Magento/Checkout/view/frontend/web/template/cart/shipping-estimation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<fieldset class="fieldset estimate">
99
<legend class="legend">
1010
<span data-bind="text: isVirtual ? $t('Estimate Tax') : $t('Estimate Shipping and Tax') "></span>
11-
</legend><br>
11+
</legend><br/>
1212
<p class="field note" data-bind="text: isVirtual ? $t('Enter your billing address to get a tax estimate.') : $t('Enter your destination to get a shipping estimate.')"></p>
1313
<!-- ko foreach: getRegion('address-fieldsets') -->
1414
<!-- ko template: getTemplate() --><!-- /ko -->

app/code/Magento/Theme/view/adminhtml/templates/tabs/css.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ require([
3535
var uploadButton = $('#css_uploader_button');
3636
/** Unbind click event on file change */
3737
uploadButton.off('click');
38-
uploadButton.removeAttr('disabled');
38+
uploadButton.prop('disabled', false);
3939
40-
uploadButton.click(function () {
40+
uploadButton.on('click', function () {
4141
$('#messages').html('');
4242
$(this).attr('disabled', 'disabled');
4343
data.submit();

app/code/Magento/Theme/view/adminhtml/templates/tabs/js.phtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ require([
5757
});
5858
5959
var uploadButton = $('#js_uploader_button');
60-
uploadButton.removeAttr('disabled');
60+
uploadButton.prop('disabled', false);
6161
62-
uploadButton.click(function () {
62+
uploadButton.on('click', function () {
6363
$('#messages').html('');
6464
$(this).attr('disabled', 'disabled');
6565
@@ -121,7 +121,7 @@ require([
121121
}
122122
});
123123
124-
$('#js_files_uploader').click(function () {
124+
$('#js_files_uploader').on('click', function () {
125125
/** Unbind click event on file change */
126126
$('#js-file-uploader').html('');
127127
$('#js_uploader_button').off('click');

app/code/Magento/Ui/view/base/web/templates/dynamic-rows/cells/thumbnail.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
* See COPYING.txt for license details.
55
*/
66
-->
7-
<img class = 'admin__control-thumbnail' style="max-height: 75px; max-width: 75px;" data-bind="attr: {src: $data.value}">
7+
<img class="admin__control-thumbnail" style="max-height: 75px; max-width: 75px;" data-bind="attr: {src: $data.value}"/>

app/code/Magento/Ui/view/base/web/templates/form/element/price.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
*/
66
-->
77
<div class="admin__control-addon">
8-
<input class="admin__control-text" type="text" data-bind="value: value, attr: { id: uid, disabled: disabled, name: inputName }, hasFocus: focused">
98
<label class="admin__addon-prefix" data-bind="attr: { for: uid }"><span data-bind="text: currency_sign"></span></label>
9+
<input class="admin__control-text" type="text" data-bind="value: value, attr: { id: uid, disabled: disabled, name: inputName }, hasFocus: focused"/>
1010
</div>

app/code/Magento/Ui/view/base/web/templates/form/element/switcher.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div class="admin__actions-switch" data-role="switcher">
88
<input class="admin__actions-switch-checkbox"
99
type="checkbox"
10-
data-bind="checked: value, attr: { id: uid, disabled: disabled, name: inputName }, hasFocus: focused">
10+
data-bind="checked: value, attr: { id: uid, disabled: disabled, name: inputName }, hasFocus: focused"/>
1111
<label class="admin__actions-switch-label"
1212
data-bind="attr: { for: uid }">
1313
<span data-bind="attr: {

app/code/Magento/Ui/view/base/web/templates/form/element/textarea.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@
1717
placeholder: placeholder,
1818
id: uid,
1919
disabled: disabled
20-
}"
21-
></textarea>
20+
}"></textarea>

app/code/Magento/Ui/view/base/web/templates/form/element/uploader/preview.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
event="load: $parent.onPreviewLoad.bind($parent)"
1616
attr="
1717
src: $parent.getFilePreview($file),
18-
alt: $file.name">
18+
alt: $file.name"/>
1919
</a>
2020

2121
<div class="actions">

app/code/Magento/Ui/view/base/web/templates/grid/cells/multiselect.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
checkedValue: $row()[$col.indexField],
1313
attr: {
1414
id: index + 'check' + $row()[$col.indexField]
15-
}">
15+
}"/>
1616
<label attr="for: index + 'check' + $row()[$col.indexField]"></label>
1717
</label>

app/code/Magento/Ui/view/base/web/templates/grid/cells/onoff.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
value: $row()[$col.indexField],
1313
attr: {
1414
id: 'check' + $row()[$col.indexField]
15-
}">
15+
}"/>
1616
<label class="admin__actions-switch-label"
1717
data-bind="
1818
attr: {

app/code/Magento/Ui/view/base/web/templates/grid/columns/image-preview.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
<span translate="'Close'"></span>
1818
</button>
1919
</div>
20-
<img class="preview" attr="src: $col.getUrl($row()), alt: $col.getTitle($row())">
20+
<img class="preview" attr="src: $col.getUrl($row()), alt: $col.getTitle($row())"/>
2121
</div>
2222
</div>

app/code/Magento/Ui/view/base/web/templates/grid/columns/multiselect.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
attr: {id: ++ko.uid},
1414
event: { change: togglePage },
1515
css: { '_indeterminate': indetermine },
16-
enable: totalRecords">
16+
enable: totalRecords"/>
1717
<label attr="for: ko.uid"></label>
1818
<button class="action-multicheck-toggle" data-toggle="dropdown"
1919
data-bind="css: { '_active': $collapsible.opened },

app/code/Magento/Ui/view/base/web/templates/grid/columns/onoff.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
data-bind="checked: allSelected(),
1919
event: { change: toggleSelectAll },
2020
css: { '_indeterminate': indetermine },
21-
enable: totalRecords">
21+
enable: totalRecords"/>
2222
<label for="mass-select-checkbox"></label>
2323
<button
2424
class="action-multicheck-toggle"

app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/bookmarks.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
keyboard: {
2727
13: applyCustom.bind($data),
2828
27: hideCustom.bind($data)
29-
}">
29+
}"/>
3030
<div class="action-dropdown-menu-item-actions">
3131
<button class="action-submit" type="button" click="applyCustom" attr="title: $t('Save all changes')">
3232
<span translate="'Submit'"></span>

app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/view.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
13: $parent.updateAndSave.bind($parent, $view.index),
1919
27: $parent.endEdit.bind($parent, $view.index)
2020
}"
21-
type="text">
21+
type="text"/>
2222
<button class="action-submit" type="button" attr="title: $t('Save all changes')" click="$parent.updateAndSave.bind($parent, $view.index)">
2323
<span translate="'Submit'"></span>
2424
</button>

app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/ui-select-optgroup.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
class="admin__control-checkbox"
4545
type="checkbox"
4646
tabindex="-1"
47-
data-bind="attr: { 'checked': $parent.root.isSelected(option.value) }">
47+
data-bind="attr: { 'checked': $parent.root.isSelected(option.value) }"/>
4848
<!--/ko-->
4949
<label
5050
class="admin__action-multiselect-label"

app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/ui-select.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
valueUpdate: 'afterkeydown',
128128
value: filterInputValue,
129129
hasFocus: filterOptionsFocus
130-
">
130+
"/>
131131
<label
132132
class="admin__action-multiselect-search-label"
133133
data-action="advanced-select-search"

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
"guzzlehttp/guzzle": "^6.3.3",
3838
"laminas/laminas-captcha": "^2.10",
3939
"laminas/laminas-code": "^3.5.1",
40-
"laminas/laminas-crypt": "^3.4.0",
4140
"laminas/laminas-db": "^2.12.0",
4241
"laminas/laminas-dependency-plugin": "^2.1.0",
4342
"laminas/laminas-di": "^3.2.0",

composer.lock

Lines changed: 1 addition & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/internal/Magento/Framework/Code/Generator/EntityAbstract.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,15 +332,15 @@ private function extractParameterType(
332332

333333
/** @var string|null $typeName */
334334
$typeName = null;
335-
336-
if ($parameter->isArray()) {
335+
$parameterType = $parameter->getType();
336+
if ($parameterType->getName() === 'array') {
337337
$typeName = 'array';
338338
} elseif ($parameterClass = $this->getParameterClass($parameter)) {
339339
$typeName = $this->_getFullyQualifiedClassName($parameterClass->getName());
340-
} elseif ($parameter->isCallable()) {
340+
} elseif ($parameterType->getName() === 'callable') {
341341
$typeName = 'callable';
342342
} else {
343-
$typeName = $parameter->getType()->getName();
343+
$typeName = $parameterType->getName();
344344
}
345345

346346
if ($parameter->allowsNull()) {

lib/internal/Magento/Framework/Code/Reader/SourceArgumentsReader.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ public function getConstructorArgumentTypes(
6060
foreach ($params as $param) {
6161
//For the sake of backward compatibility.
6262
$typeName = '';
63-
if ($param->isArray()) {
63+
$parameterType = $param->getType();
64+
if ($parameterType && $parameterType->getName() === 'array') {
6465
//For the sake of backward compatibility.
6566
$typeName = 'array';
6667
} else {
@@ -72,7 +73,7 @@ public function getConstructorArgumentTypes(
7273
} catch (\ReflectionException $exception) {
7374
//If there's a problem loading a class then ignore it and
7475
//just return it's name.
75-
$typeName = '\\' .$param->getType()->getName();
76+
$typeName = '\\' .$parameterType->getName();
7677
}
7778
}
7879
$types[] = $typeName;

lib/internal/Magento/Framework/Encryption/Helper/Security.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@
66

77
namespace Magento\Framework\Encryption\Helper;
88

9-
use Laminas\Crypt\Utils;
10-
119
/**
12-
* Class implements compareString from Laminas\Crypt
13-
*
1410
* @api
1511
* @since 100.0.2
1612
*/
@@ -19,12 +15,12 @@ class Security
1915
/**
2016
* Compare two strings in a secure way that avoids string length guessing based on duration of calculation
2117
*
22-
* @param string $expected
23-
* @param string $actual
18+
* @param string $expected
19+
* @param string $actual
2420
* @return bool
2521
*/
2622
public static function compareStrings($expected, $actual)
2723
{
28-
return Utils::compareStrings($expected, $actual);
24+
return hash_equals((string) $expected, (string) $actual);
2925
}
3026
}

lib/internal/Magento/Framework/Interception/Code/InterfaceValidator.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,10 @@ protected function validateMethodsParameters(array $pluginParameters, array $ori
172172
protected function getParametersType(ReflectionParameter $parameter)
173173
{
174174
$parameterClass = $this->getParameterClass($parameter);
175-
return $parameterClass ? '\\' . $parameterClass->getName() : ($parameter->isArray() ? 'array' : null);
175+
$parameterType = $parameter->getType();
176+
return $parameterClass ?
177+
'\\' . $parameterClass->getName() :
178+
($parameterType && $parameterType->getName() === 'array' ? 'array' : null);
176179
}
177180

178181
/**

lib/internal/Magento/Framework/TestFramework/Unit/Helper/ObjectManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ function ($className, $arguments) {
220220
if (isset($arguments[$parameterName])) {
221221
$args[] = $arguments[$parameterName];
222222
} else {
223-
if ($parameter->isArray()) {
223+
if ($parameter->getType() && $parameter->getType()->getName() === 'array') {
224224
$args[] = [];
225225
} elseif ($parameter->allowsNull()) {
226226
$args[] = null;

lib/internal/Magento/Framework/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"composer/composer": "^1.9 || ^2.0",
2727
"guzzlehttp/guzzle": "^6.3.3",
2828
"laminas/laminas-code": "^3.5.1",
29-
"laminas/laminas-crypt": "^3.4.0",
3029
"laminas/laminas-http": "^2.6.0",
3130
"laminas/laminas-mail": "^2.9.0",
3231
"laminas/laminas-mime": "^2.8.0",

lib/web/matchMedia.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license */
1+
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. MIT license */
22

33
window.matchMedia || (window.matchMedia = function() {
44
"use strict";
@@ -8,14 +8,18 @@ window.matchMedia || (window.matchMedia = function() {
88

99
// For those that don't support matchMedium
1010
if (!styleMedia) {
11-
var style = document.createElement('style'),
12-
script = document.getElementsByTagName('script')[0],
13-
info = null;
11+
var style = document.createElement('style'),
12+
script = document.getElementsByTagName('script')[0],
13+
info = null;
1414

15-
style.type = 'text/css';
16-
style.id = 'matchmediajs-test';
15+
style.type = 'text/css';
16+
style.id = 'matchmediajs-test';
1717

18-
script.parentNode.insertBefore(style, script);
18+
if (!script) {
19+
document.head.appendChild(style);
20+
} else {
21+
script.parentNode.insertBefore(style, script);
22+
}
1923

2024
// 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers
2125
info = ('getComputedStyle' in window) && window.getComputedStyle(style, null) || style.currentStyle;
@@ -141,4 +145,4 @@ window.mediaCheck = function(options) {
141145
});
142146

143147
mqChange(mq, options);
144-
};
148+
};

0 commit comments

Comments
 (0)