Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[2.7][Form] Fix \IntlDateFormatter timezone parameter usage to bypass PHP bug #66323#22996

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@romainneutron
Copy link
Contributor

QA
Branch?2.7
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsN/A
LicenseMIT
Doc PRN/A

The issue is documented here.
The current symfony code works whenintl.use_exception is off. however, it's on on PHP 7+ and the issue is reproducible. Seehttps://3v4l.org/PllP1 andhttps://3v4l.org/3XnKI

@romainneutronromainneutron changed the title[Form] Fix \IntlDateFormatter timezone parameter usage to bypass PHP bug #66323[2.7][Form] Fix \IntlDateFormatter timezone parameter usage to bypass PHP bug #66323May 31, 2017
Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

👍

Copy link
Contributor

@HeahDudeHeahDude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

👍

$dateFormat =$this->dateFormat;
$timeFormat =$this->timeFormat;
$timezone =$ignoreTimezone ?'UTC' :$this->outputTimezone;
if (!defined('HHVM_VERSION') &&PHP_VERSION_ID >=50500) {
Copy link
Member

@nicolas-grekasnicolas-grekasMay 31, 2017
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It looks like this could enhance portability:

if (class_exists('IntlTimeZone', false)) {    $timezone = \IntlTimeZone::createTimeZone($timezone)}

$timeFormat,
null,
// see https://bugs.php.net/bug.php?id=66323
defined('HHVM_VERSION') ||PHP_VERSION_ID <50500 ?null :new \DateTimeZone(date_default_timezone_get()),
Copy link
Member

@nicolas-grekasnicolas-grekasMay 31, 2017
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

class_exists('IntlTimeZone', false) ? \IntlTimeZone::createDefault() : null

@romainneutron
Copy link
ContributorAuthor

PR updated, comments addressed

@nicolas-grekas
Copy link
Member

Thank you@romainneutron.

@nicolas-grekasnicolas-grekas merged commitf42c73f intosymfony:2.7Jun 1, 2017
nicolas-grekas added a commit that referenced this pull requestJun 1, 2017
…e to bypass PHP bug #66323 (romainneutron)This PR was merged into the 2.7 branch.Discussion----------[2.7][Form] Fix \IntlDateFormatter timezone parameter usage to bypass PHP bug #66323| Q             | A| ------------- | ---| Branch?       | 2.7| Bug fix?      | yes| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->| BC breaks?    | no| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->| Tests pass?   | yes| Fixed tickets | N/A <!-- #-prefixed issue number(s), if any -->| License       | MIT| Doc PR        | N/AThe issue is documented here.The current symfony code works when `intl.use_exception` is off. however, it's on on PHP 7+ and the issue is reproducible. Seehttps://3v4l.org/PllP1 andhttps://3v4l.org/3XnKICommits-------f42c73f [Form] Fix \IntlDateFormatter timezone parameter usage to bypass PHP bug #66323
@romainneutronromainneutron deleted the 2.7-intl-dateformatter branchJune 1, 2017 13:25
This was referencedJun 5, 2017
@fabpotfabpot mentioned this pull requestJul 4, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

+1 more reviewer

@HeahDudeHeahDudeHeahDude approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@romainneutron@nicolas-grekas@HeahDude@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp