1
0
mirror of https://github.com/rlanvin/php-rrule.git synced 2025-02-20 09:54:16 +01:00

fixed Warning in RRule->humanReadable() (#44)

* only LC_ALL in setlocale

[ Warning: Use of undefined constant LC_MESSAGES - assumed 'LC_MESSAGES' (this will throw an Error in a future version of PHP) in ...vendor\rlanvin\php-rrule\src\RRule.php on line 2340 ]

LC_MESSAGES is not available. It is available only if PHP was compiled with libintl.
use LC_ALL instead.
This commit is contained in:
Ricardo Rivera 2018-02-27 11:32:52 +01:00 committed by Rémi Lanvin
parent 758fcffe59
commit 6328e604ea

View File

@ -2337,7 +2337,7 @@ class RRule implements RRuleInterface
if ( $opt['use_intl'] ) {
$default_opt['locale'] = \Locale::getDefault();
} else {
$default_opt['locale'] = setlocale(LC_MESSAGES, 0);
$default_opt['locale'] = setlocale(LC_ALL, 0);
if ( $default_opt['locale'] == 'C' ) {
$default_opt['locale'] = 'en';
}