-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form] Fix DateType for 32bits computers. #9314
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
@@ -300,7 +300,9 @@ private function listYears(array $years) | |||
$result = array(); | |||
|
|||
foreach ($years as $year) { | |||
$result[$year] = gmmktime(0, 0, 0, 6, 15, $year); | |||
if(($y = gmmktime(0, 0, 0, 6, 15, $year)) !== false) { |
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.
cs: if (false !== $y = gmmktime(0, 0, 0, 6, 15, $year)) {
ping @bschussek |
@@ -300,7 +300,9 @@ private function listYears(array $years) | |||
$result = array(); | |||
|
|||
foreach ($years as $year) { | |||
$result[$year] = gmmktime(0, 0, 0, 6, 15, $year); | |||
if(false !== $y = gmmktime(0, 0, 0, 6, 15, $year)) { |
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 (
notice the space
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.
As @cordoval mentioned, could you please insert a space after the if
?
Thank you for fixing this bug! :) Could you please add a test case for this issue? You can add the following code on top of your test to disable it on non-32-bit architectures: if (4 !== PHP_INT_SIZE) {
$testCase->markTestSkipped('PHP must be compiled in 32 bit mode to run this test');
} |
Test case to check years on 32bits machine.
This PR was squashed before being merged into the 2.2 branch (closes #9314). Discussion ---------- [Form] Fix DateType for 32bits computers. | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #5227,#5554 | License | MIT | Doc PR | - Fix an issue due to 32bits machines, date can be only between 1902-2037. Simply not add date if false. Can be good to add this to 2.3 and master too. Commits ------- b80fb43 [Form] Fix DateType for 32bits computers.
This PR was merged into the 4.1-dev branch. Discussion ---------- [FrameworkBundle] keep query in redirect | Q | A | ------------- | --- | Branch? | 4.1 | Bug fix? | no | New feature? | yes <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #26256 <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | #9314 <!-- Write a short README entry for your feature/bugfix here (replace this comment block.) This will help people understand your PR and can be used as a start of the Doc PR. Additionally: - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. --> Commits ------- 406bfc9 [FrameworkBundle] keep query params in redirection
Fix an issue due to 32bits machines, date can be only between 1902-2037.
Simply not add date if false. Can be good to add this to 2.3 and master too.