-
Notifications
You must be signed in to change notification settings - Fork 7.9k
GH-12943 ext/intl accept C as acceptable locale argument. #12955
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
I don't have approval authority, but it looks good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable to me,not sure if we should add for a backport to 8.1 considering that this bug was introduced late in the release cycle, @ramsey opinions?
$fmt = new IntlDateFormatter( | ||
'C', | ||
IntlDateFormatter::FULL, | ||
IntlDateFormatter::FULL, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: CS
$fmt = new IntlDateFormatter( | |
'C', | |
IntlDateFormatter::FULL, | |
IntlDateFormatter::FULL, | |
); | |
$fmt = new IntlDateFormatter( | |
'C', | |
IntlDateFormatter::FULL, | |
IntlDateFormatter::FULL, | |
); |
@@ -112,7 +112,7 @@ static zend_result datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_error_handlin | |||
} | |||
locale = Locale::createFromName(locale_str); | |||
/* get*Name accessors being set does not preclude being bogus */ | |||
if (locale.isBogus() || strlen(locale.getISO3Language()) == 0) { | |||
if (locale.isBogus() || (strcmp("C", locale_str) && strlen(locale.getISO3Language()) == 0)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (locale.isBogus() || (strcmp("C", locale_str) && strlen(locale.getISO3Language()) == 0)) { | |
if (locale.isBogus() || (locale_str == 1 && locale_str[0] == 'C') && strlen(locale.getISO3Language()) == 0)) { |
The call to strcmp() is not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you meant locale_len == 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes indeed
6067f33
to
158dea6
Compare
No description provided.