Skip to content

Commit d731bd4

Browse files
committed
Fix accepted types for escaper methods, more then only strict string types are allowed.
1 parent edee5b1 commit d731bd4

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

app/code/Magento/Sales/Block/Adminhtml/Order/Comments/View.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function canSendCommentEmail()
109109
/**
110110
* Replace links in string
111111
*
112-
* @param array|string $data
112+
* @param string|int|float|\Stringable|array<string|int|float|\Stringable> $data
113113
* @param null|array $allowedTags
114114
* @return string
115115
*/

app/code/Magento/Sales/Block/Adminhtml/Order/View/History.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public function isCustomerNotificationNotApplicable(\Magento\Sales\Model\Order\S
132132
/**
133133
* Replace links in string
134134
*
135-
* @param array|string $data
135+
* @param string|int|float|\Stringable|array<string|int|float|\Stringable> $data
136136
* @param null|array $allowedTags
137137
* @return string
138138
*/

app/code/Magento/Sales/Helper/Admin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public function applySalableProductTypesFilter($collection)
154154
/**
155155
* Escape string preserving links
156156
*
157-
* @param string $data
157+
* @param string|int|float|\Stringable|array<string|int|float|\Stringable> $data
158158
* @param null|array $allowedTags
159159
* @return string
160160
*/

lib/internal/Magento/Framework/Escaper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class Escaper
7070
* AllowedTags will not be escaped, except the following: script, img, embed,
7171
* iframe, video, source, object, audio
7272
*
73-
* @param string|array $data
73+
* @param string|int|float|\Stringable|array<string|int|float|\Stringable> $data
7474
* @param array|null $allowedTags
7575
* @return string|array
7676
*/
@@ -267,7 +267,7 @@ private function escapeAttributeValue($name, $value)
267267
/**
268268
* Escape a string for the HTML attribute context
269269
*
270-
* @param string $string
270+
* @param string|int|float|\Stringable $string
271271
* @param boolean $escapeSingleQuote
272272
* @return string
273273
* @since 101.0.0
@@ -313,7 +313,7 @@ public function encodeUrlParam($string)
313313
/**
314314
* Escape string for the JavaScript context
315315
*
316-
* @param string $string
316+
* @param string|int|float|\Stringable $string
317317
* @return string
318318
* @since 101.0.0
319319
*/

lib/internal/Magento/Framework/View/Element/AbstractBlock.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ public static function extractModuleName($className)
892892
/**
893893
* Escape HTML entities
894894
*
895-
* @param string|array $data
895+
* @param string|int|float|\Stringable|array<string|int|float|\Stringable> $data
896896
* @param array|null $allowedTags
897897
* @return string
898898
* @deprecated 103.0.0 Use $escaper directly in templates and in blocks.
@@ -906,7 +906,7 @@ public function escapeHtml($data, $allowedTags = null)
906906
/**
907907
* Escape string for the JavaScript context
908908
*
909-
* @param string $string
909+
* @param string|int|float|\Stringable $string
910910
* @return string
911911
* @since 101.0.0
912912
* @deprecated 103.0.0 Use $escaper directly in templates and in blocks.
@@ -920,7 +920,7 @@ public function escapeJs($string)
920920
/**
921921
* Escape a string for the HTML attribute context
922922
*
923-
* @param string $string
923+
* @param string|int|float|\Stringable $string
924924
* @param boolean $escapeSingleQuote
925925
* @return string
926926
* @since 101.0.0

0 commit comments

Comments
 (0)