zencart / zencart

Zen Cart® is a full-function e-commerce application for your website.
https://github.com/zencart/zencart/releases
Other
375 stars 233 forks source link

zcDate causing fatal error Uncaught IntlException: datefmt_create: invalid locale: U_ILLEGAL_ARGUMENT_ERROR #6037

Closed brittainmark closed 11 months ago

brittainmark commented 11 months ago

Describe the bug The latest versions of php are causing an error when locale is not set. This causes a white screen.

Version Zen Cart version: 1.5.8 PHP version: 8.1,8.2 MySQL version: n/a Plugins that may be related: n/a

To Reproduce go to home page of store or admin

Expected behavior site is displayed

Debug/Error Logs [02-Nov-2023 12:04:33 UTC] PHP Fatal error: Uncaught IntlException: datefmt_create: invalid locale: U_ILLEGAL_ARGUMENT_ERROR in /home/lotus/public_html/innerlightcrystals/sales/includes/classes/zcDate.php:87 Stack trace:

0 /home/lotus/public_html/innerlightcrystals/sales/includes/classes/zcDate.php(87): IntlDateFormatter->__construct()

1 /home/lotus/public_html/innerlightcrystals/sales/includes/classes/zcDate.php(39): zcDate->initializeConversionArrays()

2 /home/lotus/public_html/innerlightcrystals/sales/includes/autoload_func.php(47): zcDate->__construct()

3 /home/lotus/public_html/innerlightcrystals/sales/YOURADMIN/includes/application_top.php(42): require('...')

4 /home/lotus/public_html/innerlightcrystals/sales/YOURADMIN/home.php(9): require('...')

5 /home/lotus/public_html/innerlightcrystals/sales/YOURADMIN/index.php(11): require('...')

6 {main}

thrown in /home/lotus/public_html/innerlightcrystals/sales/includes/classes/zcDate.php on line 87

[02-Nov-2023 12:04:33 UTC] Request URI: /sales/YOURADMIN/, IP address: 127.0.0.1 --> PHP Fatal error: Uncaught IntlException: datefmt_create: invalid locale: U_ILLEGAL_ARGUMENT_ERROR in /home/lotus/public_html/innerlightcrystals/sales/includes/classes/zcDate.php:87 Stack trace:

0 /home/lotus/public_html/innerlightcrystals/sales/includes/classes/zcDate.php(87): IntlDateFormatter->__construct()

1 /home/lotus/public_html/innerlightcrystals/sales/includes/classes/zcDate.php(39): zcDate->initializeConversionArrays()

2 /home/lotus/public_html/innerlightcrystals/sales/includes/autoload_func.php(47): zcDate->__construct()

3 /home/lotus/public_html/innerlightcrystals/sales/YOURADMIN/includes/application_top.php(42): require('...')

4 /home/lotus/public_html/innerlightcrystals/sales/YOURADMIN/home.php(9): require('...')

5 /home/lotus/public_html/innerlightcrystals/sales/YOURADMIN/index.php(11): require('...')

6 {main}

thrown in /home/lotus/public_html/innerlightcrystals/sales/includes/classes/zcDate.php on line 87.

Devices (please complete the following information):

Additional context https://www.zen-cart.com/showthread.php?229770-Site-Crashed-U_ILLEGAL_ARGUMENT_ERROR

It can be fixed by setting locale in index.php. I don't think this is the correct solution.

drbyte commented 11 months ago

Ya, PHP is suddenly enforcing a valid locale instead of silently ignoring it. We've been discussing various approaches to accommodate their breaking change in #6010

brittainmark commented 11 months ago

THis is now affecting live system. sorry missed that change. will close and add to #6010