Skip to content

Commit 22d7c51

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: Using FQ name for PHP_VERSION_ID [Form] Fix \IntlDateFormatter timezone parameter usage to bypass PHP bug #66323 Harden the debugging of Twig filters and functions bumped Symfony version to 2.7.29 updated VERSION for 2.7.28 update CONTRIBUTORS for 2.7.28 updated CHANGELOG for 2.7.28
2 parents 698ba1c + 0fdc793 commit 22d7c51

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ protected function getIntlDateFormatter($ignoreTimezone = false)
163163
$dateFormat = $this->dateFormat;
164164
$timeFormat = $this->timeFormat;
165165
$timezone = $ignoreTimezone ? 'UTC' : $this->outputTimezone;
166+
if (class_exists('IntlTimeZone', false)) {
167+
// see https://bugs.php.net/bug.php?id=66323
168+
$timezone = \IntlTimeZone::createTimeZone($timezone);
169+
}
166170
$calendar = $this->calendar;
167171
$pattern = $this->pattern;
168172

Extension/Core/Type/DateType.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ public function buildForm(FormBuilderInterface $builder, array $options)
8282
\Locale::getDefault(),
8383
$dateFormat,
8484
$timeFormat,
85-
null,
85+
// see https://bugs.php.net/bug.php?id=66323
86+
class_exists('IntlTimeZone', false) ? \IntlTimeZone::createDefault() : null,
8687
$calendar,
8788
$pattern
8889
);
@@ -306,7 +307,7 @@ private function formatTimestamps(\IntlDateFormatter $formatter, $regex, array $
306307
$timezone = $formatter->getTimezoneId();
307308
$formattedTimestamps = array();
308309

309-
if ($setTimeZone = PHP_VERSION_ID >= 50500 || method_exists($formatter, 'setTimeZone')) {
310+
if ($setTimeZone = \PHP_VERSION_ID >= 50500 || method_exists($formatter, 'setTimeZone')) {
310311
$formatter->setTimeZone('UTC');
311312
} else {
312313
$formatter->setTimeZoneId('UTC');

Extension/Csrf/CsrfProvider/DefaultCsrfProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function isCsrfTokenValid($intention, $token)
7575
*/
7676
protected function getSessionId()
7777
{
78-
if (PHP_VERSION_ID >= 50400) {
78+
if (\PHP_VERSION_ID >= 50400) {
7979
if (PHP_SESSION_NONE === session_status()) {
8080
session_start();
8181
}

Tests/Extension/Validator/ValidatorTypeGuesserTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function testGuessRequired($constraint, $guess)
9090
*/
9191
public function testLegacyGuessRequired()
9292
{
93-
if (PHP_VERSION_ID >= 70000) {
93+
if (\PHP_VERSION_ID >= 70000) {
9494
$this->markTestSkipped('Cannot use a class called True on PHP 7 or higher.');
9595
}
9696
$true = 'Symfony\Component\Validator\Constraints\True';

0 commit comments

Comments
 (0)