-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fix accepted types for escaper methods #40114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hostep
wants to merge
4
commits into
magento:2.4-develop
Choose a base branch
from
hostep:fix-accepted-types-for-escaper-methods
base: 2.4-develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+22
−22
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
d731bd4
Fix accepted types for escaper methods, more then only strict string …
hostep f7c7a81
Changed return type of escapeHtml method to a conditional, so phpstan…
hostep 47aa3b3
Fixes static tests.
hostep 28dde3c
Merge branch '2.4-develop' into fix-accepted-types-for-escaper-methods
engcom-Hotel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,7 +1,7 @@ | ||||||
<?php | ||||||
/** | ||||||
* Copyright © Magento, Inc. All rights reserved. | ||||||
* See COPYING.txt for license details. | ||||||
* Copyright 2013 Adobe | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
* All Rights Reserved. | ||||||
*/ | ||||||
declare(strict_types=1); | ||||||
|
||||||
|
@@ -154,9 +154,9 @@ public function applySalableProductTypesFilter($collection) | |||||
/** | ||||||
* Escape string preserving links | ||||||
* | ||||||
* @param string $data | ||||||
* @param string|int|float|\Stringable|array<string|int|float|\Stringable> $data | ||||||
* @param null|array $allowedTags | ||||||
* @return string | ||||||
* @return ($data is array ? string[] : string) | ||||||
*/ | ||||||
public function escapeHtmlWithLinks($data, $allowedTags = null) | ||||||
{ | ||||||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,7 +1,7 @@ | ||||||
<?php | ||||||
/** | ||||||
* Copyright © Magento, Inc. All rights reserved. | ||||||
* See COPYING.txt for license details. | ||||||
* Copyright 2014 Adobe | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
* All Rights Reserved. | ||||||
*/ | ||||||
declare(strict_types=1); | ||||||
|
||||||
|
@@ -70,9 +70,9 @@ class Escaper | |||||
* AllowedTags will not be escaped, except the following: script, img, embed, | ||||||
* iframe, video, source, object, audio | ||||||
* | ||||||
* @param string|array $data | ||||||
* @param string|int|float|\Stringable|array<string|int|float|\Stringable> $data | ||||||
* @param array|null $allowedTags | ||||||
* @return string|array | ||||||
* @return ($data is array ? string[] : string) | ||||||
*/ | ||||||
public function escapeHtml($data, $allowedTags = null) | ||||||
{ | ||||||
|
@@ -267,7 +267,7 @@ private function escapeAttributeValue($name, $value) | |||||
/** | ||||||
* Escape a string for the HTML attribute context | ||||||
* | ||||||
* @param string $string | ||||||
* @param string|int|float|\Stringable $string | ||||||
* @param boolean $escapeSingleQuote | ||||||
* @return string | ||||||
* @since 101.0.0 | ||||||
|
@@ -313,7 +313,7 @@ public function encodeUrlParam($string) | |||||
/** | ||||||
* Escape string for the JavaScript context | ||||||
* | ||||||
* @param string $string | ||||||
* @param string|int|float|\Stringable $string | ||||||
* @return string | ||||||
* @since 101.0.0 | ||||||
*/ | ||||||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,7 +1,7 @@ | ||||||
<?php | ||||||
/** | ||||||
* Copyright © Magento, Inc. All rights reserved. | ||||||
* See COPYING.txt for license details. | ||||||
* Copyright 2014 Adobe | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
* All Rights Reserved. | ||||||
*/ | ||||||
declare(strict_types=1); | ||||||
|
||||||
|
@@ -892,9 +892,9 @@ public static function extractModuleName($className) | |||||
/** | ||||||
* Escape HTML entities | ||||||
* | ||||||
* @param string|array $data | ||||||
* @param string|int|float|\Stringable|array<string|int|float|\Stringable> $data | ||||||
* @param array|null $allowedTags | ||||||
* @return string | ||||||
* @return ($data is array ? string[] : string) | ||||||
* @deprecated 103.0.0 Use $escaper directly in templates and in blocks. | ||||||
* @see Escaper Usage | ||||||
*/ | ||||||
|
@@ -906,7 +906,7 @@ public function escapeHtml($data, $allowedTags = null) | |||||
/** | ||||||
* Escape string for the JavaScript context | ||||||
* | ||||||
* @param string $string | ||||||
* @param string|int|float|\Stringable $string | ||||||
* @return string | ||||||
* @since 101.0.0 | ||||||
* @deprecated 103.0.0 Use $escaper directly in templates and in blocks. | ||||||
|
@@ -920,7 +920,7 @@ public function escapeJs($string) | |||||
/** | ||||||
* Escape a string for the HTML attribute context | ||||||
* | ||||||
* @param string $string | ||||||
* @param string|int|float|\Stringable $string | ||||||
* @param boolean $escapeSingleQuote | ||||||
* @return string | ||||||
* @since 101.0.0 | ||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@engcom-Hotel: it should be 2013, not 2011. Looking at the git history, github is guessing it got renamed from
app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Price/Scope.php
toapp/code/core/Mage/Adminhtml/Block/Tax/Rate/ImportExportHeader.php
in 2011 and then toapp/code/Magento/Adminhtml/Block/Sales/Order/View/History.php
in 2013But going from a PriceScopeBackendConfig to a TaxRateImportExportHeader to a SalesOrderViewHistoryBlock makes no sense to me. So in my opinion it should be 2013.
Can you double check this again?
I didn't check the other files, only this one...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you really believe it should be 2011, go ahead and change it yourself because I'm unavailable for the next 2 weeks, since I'll go on holiday. Thanks!