-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Open
Labels
Area: FrameworkComponent: ExceptionIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P3May be fixed according to the position in the backlog.May be fixed according to the position in the backlog.Reported on 2.4.8-p2Indicates original Magento version for the Issue report.Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchThe issue has been reproduced on latest 2.4-develop branch
Description
Preconditions and environment
- Magento version: 2.4.8-p2
Steps to reproduce
- Navigate to your magento store with a urlencoded non-utf8 character https://example.com/%C0, another example with a utf8 character but it being an emoj https://example.com/🔎
- See as an error gets produced because invalid characters are put into the mysql query
Expected result
A 404 page, or redirect if it has been set
Actual result
An error gets thrown:
SQLSTATE[HY000]: General error: 1271 Illegal mix of collations for operation ' IN ', query was: SELECT `url_rewrite`.* FROM `url_rewrite` WHERE (`request_path` IN ('%C0', '%C0/', '�', '�/')) AND (`store_id` IN ('1'))
Additional information
This error comes from: vendor/magento/module-url-rewrite/Model/Storage/DbStorage.php@doFindOneByData
Changing the code like this, does fix it. Question is, is it the right way?
- $decodedRequestPath = urldecode($requestPath);
+ $decodedRequestPath = mb_convert_encoding(urldecode($requestPath), 'UTF-8');
This replaces those unknown characters to ?
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
bigbangx
Metadata
Metadata
Assignees
Labels
Area: FrameworkComponent: ExceptionIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P3May be fixed according to the position in the backlog.May be fixed according to the position in the backlog.Reported on 2.4.8-p2Indicates original Magento version for the Issue report.Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchThe issue has been reproduced on latest 2.4-develop branch
Type
Projects
Status
Ready for Development