Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
d234130 to214fa1bCompare
nicolas-grekas left a comment
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.
👍
HeahDude left a comment
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.
👍
| $dateFormat =$this->dateFormat; | ||
| $timeFormat =$this->timeFormat; | ||
| $timezone =$ignoreTimezone ?'UTC' :$this->outputTimezone; | ||
| if (!defined('HHVM_VERSION') &&PHP_VERSION_ID >=50500) { |
nicolas-grekasMay 31, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
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()), |
nicolas-grekasMay 31, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
class_exists('IntlTimeZone', false) ? \IntlTimeZone::createDefault() : null
214fa1b tof42c73fCompareromainneutron commentedJun 1, 2017
PR updated, comments addressed |
nicolas-grekas commentedJun 1, 2017
Thank you@romainneutron. |
…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
The issue is documented here.
The current symfony code works when
intl.use_exceptionis off. however, it's on on PHP 7+ and the issue is reproducible. Seehttps://3v4l.org/PllP1 andhttps://3v4l.org/3XnKI