Skip to content
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

Infinite loop in BundleEntryReader after updating php7.2-intl to 7.2.17 which installs libicu64 #31089

Closed
megawilddaddy opened this issue Apr 12, 2019 · 13 comments
Labels

Comments

@megawilddaddy
Copy link

megawilddaddy commented Apr 12, 2019

PHP 7.2.17-1+ubuntu18.04.1+deb.sury.org+3
SYMFONY: Symfony 4.2.4

locale_parse('root') now return an empty array as opposed to previos php versions which makes the Symfony\Component\Intl\Data\Bundle\Reader loop through fallback locales as

"en" => "root" => "" => "root" => "" and so on without it becoming null to break the loop

when reading from the regions because in the Symfony\Component\Intl\Locale::getFallback()
we never get inside the if (1 === \count($localeSubTags))

testedLocales

@megawilddaddy megawilddaddy changed the title Error with root locale after updating php7.2-intl to 7.2.17 which installs libicu64 Infinite loop in BundleEntryReader after updating php7.2-intl to 7.2.17 which installs libicu64 Apr 12, 2019
@ro0NL
Copy link
Contributor

ro0NL commented Apr 12, 2019

confirmed 👍 PR welcome i guess :)

@enricog84
Copy link

I just had the same issue after upgrading to php version 7.1.28 from 7.1.27.
Using latest symfony 3.4.24 fixed the issue. Imo the additional check in Location.php in the pull request #30781 fixed the issue.

@ro0NL
Copy link
Contributor

ro0NL commented Apr 12, 2019

So this is fixed in 4.2.5, @megawilddaddy can you try upgrading to see if it solves your issue as well?

@megawilddaddy
Copy link
Author

Yes, upgrading to 4.2.5 fixed the issue.
Thanks guys!

@vkhramtsov
Copy link
Contributor

@ro0NL Do we have any chance to get this fix for 2.8 version?

@jakzal
Copy link
Contributor

jakzal commented Apr 23, 2019

@vkhramtsov no, 2.8 only receives security fixes at this point.

@vkhramtsov
Copy link
Contributor

@jakzal I agree that it is not security fix, but this bug makes symfony completely unusable in some cases

@vkhramtsov
Copy link
Contributor

@fabpot What do you think?

@vkhramtsov
Copy link
Contributor

Anyway I've forked and fixed intl

@fabpot
Copy link
Member

fabpot commented Apr 24, 2019

As @jakzal said, 2.8 is not maintained anymore, you should upgrade to 3.4 or downgrade PHP to a working version.

@vkhramtsov
Copy link
Contributor

@fabpot Thank you for clarification

@alexander-schranz
Copy link
Contributor

alexander-schranz commented Apr 26, 2019

We had the same problem on some projects so we did overwrite the Locale.php class of the symfony/intl. The package is available under https://github.com/sulu/symfony-intl-fix. But I really would recommend to update to 3.4 and only use it as a temporary solution.

EDIT: See also @TomasVotruba comment if you want to use vendor patches composer plugin: #31089 (comment)

@TomasVotruba
Copy link
Contributor

TomasVotruba commented Jun 16, 2022

@alexander-schranz Thanks for sharing the solution 👏
We're just upgrading from Symfony 2.8 and this is one infinite loop blocker.

Note for similar legacy upgrades: exact commit that fixes it: symfony/intl@d2ac837
Then use vendor patches or similar to apply to your /vendor. Works like a charm 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants