-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
function escapeUrl accept only string #20
Comments
It seems like a similar problem happens for |
Seems about right: they always expected a `string` as input, and it should
be a `string` as input.
The bug here is on the call side, not in the escaper.
…On Fri, Jun 25, 2021, 12:14 Matthias Glaub ***@***.***> wrote:
It seems like the same happens for escapeHtmlAttr, escapeJs and escapeCss
after declare(strict_types=1); was introduced in 2.7.1 yesterday.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#20 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABFVEE3MNHONJMTMI3A2KDTURJIZANCNFSM47JSTDAQ>
.
|
I can confirm this bug. I got the following PHP warnings after update from
|
Again: not a bug, but expected behaviour.
`string` has always been the documented input type, so please do adjust to
it
…On Fri, Jun 25, 2021, 12:23 Oliver Burk ***@***.***> wrote:
I can confirm this bug. I got the following PHP warnings after update from
laminas/laminas-escaper version 2.7.0 to 2.7.1
[25-Jun-2021 11:49:32 Europe/Berlin] TypeError: preg_match() expects parameter 2 to be string, int given in /backend/vendor/laminas/laminas-escaper/src/Escaper.php:403
#0 /backend/vendor/laminas/laminas-escaper/src/Escaper.php(403): preg_match('/^./su', 1045)
#1 /backend/vendor/laminas/laminas-escaper/src/Escaper.php(371): Laminas\Escaper\Escaper->isUtf8(1045)
#2 /backend/vendor/laminas/laminas-escaper/src/Escaper.php(204): Laminas\Escaper\Escaper->toUtf8(1045)
#3 /backend/lib/Base/Helper/String.php(2202): Laminas\Escaper\Escaper->escapeHtmlAttr(1045)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#20 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABFVEFLNERO64I2GP5RFLDTURKJ3ANCNFSM47JSTDAQ>
.
|
I agree it is not a technical bug, but it is not common to change function behavior inside a patch release. |
Well, yes. laminas-escaper/src/Escaper.php Lines 205 to 207 in 77c248d
@Ocramius |
Agree on the patch release change.
As for accepting integers: no, that is categorically excluded by the API
definition of these methods, since a decade.
…On Fri, Jun 25, 2021, 12:56 Oliver Burk ***@***.***> wrote:
I agree it is not a technical bug, but it is not common to change function
behavior inside a patch release.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#20 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABFVEF5UMZCS6BTTKEHFFTTUROGTANCNFSM47JSTDAQ>
.
|
Ok, I'm fine with it 👍 but not happy :-D |
I can't see the products on both the frontend and the admin panel. TypeError: rawurlencode() expects parameter 1 to be string, bool given in /vendor/laminas/laminas-escaper/src/Escaper.php:246 |
Closing here: please refer to your stack trace, and find the first occurrence of a call to the The API signature states that only This That is from 2012-07-04, which is 9 years ago. no release allowed for |
issued in magento as magento/magento2#33346 with a fix in PR magento/magento2#33353. |
@Ocramius: thanks for linking to this issue, I didn't see it before because it was already closed. Should we at least keep it open and have a further discussion about this? Would be great if we can remove the This package is part of a framework, you should try to do your best to not cause backwards compatible breaking changes if possible. |
@hostep see #21 (comment) |
This package was never compatible with non- BC compliance is all fine (I literally made a whole talk about it, and wrote tooling to check it), but it is limited to what is considered acceptable usage. |
Accident or not it was still compatible with non-string values, and was also not enforcing types either so surely any change to rectify that accident would be a BC breaking change, regardless of any amount documentation/history to that function? I agree these things need to be enforced, and that Magento needs to sort its side out, but I agree with @hostep that this should be a major change, not a patch. |
Totally agree, I really think that adding |
You evidently have some properly invalid scenarios in there. I'm closing + locking here - the chapter is closed, and specified types are not an opinion. |
Bug Report
Can't view any product in magento in admin panel
Summary
Current behavior
TypeError: rawurlencode() expects parameter 1 to be string, int given in /var/www/vhosts/wag.ls/html/vendor/laminas/laminas-escaper/src/Escaper.php:246
How to reproduce
Expected behavior
The text was updated successfully, but these errors were encountered: