Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a1b5079

Browse files
committed
bug #34203 [FrameworkBundle] [HttpKernel] fixed correct EOL and EOM month (erics86)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #34203). Discussion ---------- [FrameworkBundle] [HttpKernel] fixed correct EOL and EOM month Q | A -- | -- Branch? | 3.4 Bug fix? | yes New feature? | no Deprecations? | no Tickets | - License | MIT Doc PR | - Commits ------- 613717d [FrameworkBundle] [HttpKernel] fixed correct EOL and EOM month
2 parents 85bcd9d + 613717d commit a1b5079

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private static function formatFileSize($path)
123123

124124
private static function isExpired($date)
125125
{
126-
$date = \DateTime::createFromFormat('m/Y', $date);
126+
$date = \DateTime::createFromFormat('d/m/Y', '01/'.$date);
127127

128128
return false !== $date && new \DateTime() > $date->modify('last day of this month 23:59:59');
129129
}

src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ public function collect(Request $request, Response $response, \Exception $except
8181

8282
$this->data['symfony_state'] = $this->determineSymfonyState();
8383
$this->data['symfony_minor_version'] = sprintf('%s.%s', Kernel::MAJOR_VERSION, Kernel::MINOR_VERSION);
84-
$eom = \DateTime::createFromFormat('m/Y', Kernel::END_OF_MAINTENANCE);
85-
$eol = \DateTime::createFromFormat('m/Y', Kernel::END_OF_LIFE);
84+
$eom = \DateTime::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_MAINTENANCE);
85+
$eol = \DateTime::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_LIFE);
8686
$this->data['symfony_eom'] = $eom->format('F Y');
8787
$this->data['symfony_eol'] = $eol->format('F Y');
8888
}
@@ -314,8 +314,8 @@ public function getName()
314314
private function determineSymfonyState()
315315
{
316316
$now = new \DateTime();
317-
$eom = \DateTime::createFromFormat('m/Y', Kernel::END_OF_MAINTENANCE)->modify('last day of this month');
318-
$eol = \DateTime::createFromFormat('m/Y', Kernel::END_OF_LIFE)->modify('last day of this month');
317+
$eom = \DateTime::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_MAINTENANCE)->modify('last day of this month');
318+
$eol = \DateTime::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_LIFE)->modify('last day of this month');
319319

320320
if ($now > $eol) {
321321
$versionState = 'eol';

0 commit comments

Comments
 (0)