-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Replaced PHP8-only str_contains method. #33886
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
Conversation
Hi @reense. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
Hi @bgorski, thank you for the review. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
lib/internal/Magento/Framework/Filesystem/Directory/DenyListPathValidator.php
Outdated
Show resolved
Hide resolved
I just updated the PR to be equal to the official hotfix described here: |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
Hi @Den4ik, thank you for the review. |
Hi @ihor-sviziev, thank you for the review. |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
I tried to reproduce the issue using 2.4-develop and could not reproduce at all! But there is a way I found out to check the str_contains() function compatibility
Well, updated PR code changes will help in resolving the issue as well where we have to reset the bootstrap.php class changes before the re execution! |
✔️ QA Passed Preconditions:
Manual testing scenario:
Before: ✖️ str_contains() - a php8 version method was used After: ✔️ Backed the code to php7 version one Successfully executed all import/composer update/ upgrade commands without any issues There is no additional testing is required as the fix was related to a one line of code that was impacted due to version change, and the 2.4.2-p2 code has been used back to solve the issue. Hence no regression is require as all the automation testing jobs are working fine. |
@magento give me test instance |
Hi @engcom-Alfa. Thank you for your request. I'm working on Magento instance for you. |
Hi @engcom-Alfa, here is your Magento Instance: https://1fe1b3b8e6ad4b789c9ad40388e3bb85.instances.magento-community.engineering |
Hi @reense, thank you for your contribution! |
Description (*)
This PR removes the PHP8-only method str_contains and replaces it with the traditional stripos() check with false, which is available since PHP5.
The reason for using this older method are the Magento 2.4 system requirements: Magento 2.4 supports PHP7.4 which does not contain the str_contains method source. The latest version of Magento, 2.4.3, does not even support PHP 8 source.
This issue has to be fixed, since it breaks upgrading a Magento instance on PHP 7.4. (see Manual error-reproducing scenario)
Related Pull Requests
Fixed Issues (if relevant)
Manual error-reproducing scenario
composer require magento/product-community-edition=2.4.3 --no-update
composer update
call to undefined method str_contains().
Questions or comments
Contribution checklist (*)