Skip to content

Commit 5057944

Browse files
committed
minor symfony#10380 fixed some HHVM bugs (fabpot)
This PR was merged into the 2.3 branch. Discussion ---------- fixed some HHVM bugs | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a This is a workaround for facebook/hhvm#1161. I made the change as the workaround does the same thing and the eval is part of unit tests. Commits ------- d014dac made Cookie stringification more robust fa24749 [Yaml] fix for a HHVM bug
2 parents b3cf27a + d014dac commit 5057944

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/Symfony/Component/BrowserKit/Cookie.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function __toString()
9696
throw new \UnexpectedValueException(sprintf('The cookie expiration time "%s" is not valid.'), $this->expires);
9797
}
9898

99-
$cookie .= '; expires='.substr($dateTime->format(self::$dateFormats[0]), 0, -5);
99+
$cookie .= '; expires='.str_replace('+0000', '', $dateTime->format(self::$dateFormats[0]));
100100
}
101101

102102
if ('' !== $this->domain) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ private function getCookieHeader($name, $value, $expires, $path, $domain, $secur
304304
}
305305
}
306306

307-
$cookie .= '; expires='.substr(\DateTime::createFromFormat('U', $expires, new \DateTimeZone('UTC'))->format('D, d-M-Y H:i:s T'), 0, -5);
307+
$cookie .= '; expires='.str_replace('+0000', '', \DateTime::createFromFormat('U', $expires, new \DateTimeZone('GMT'))->format('D, d-M-Y H:i:s T'));
308308
}
309309

310310
if ($domain) {

src/Symfony/Component/Yaml/Tests/DumperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function testSpecifications()
9595
} elseif (isset($test['todo']) && $test['todo']) {
9696
// TODO
9797
} else {
98-
$expected = eval('return '.trim($test['php']).';');
98+
eval('$expected = '.trim($test['php']).';');
9999

100100
$this->assertEquals($expected, $this->parser->parse($this->dumper->dump($expected, 10)), $test['test']);
101101
}

src/Symfony/Component/Yaml/Tests/ParserTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ public function getDataFormSpecifications()
6262
if (isset($test['todo']) && $test['todo']) {
6363
// TODO
6464
} else {
65-
$expected = var_export(eval('return '.trim($test['php']).';'), true);
65+
eval('$expected = '.trim($test['php']).';');
6666

67-
$tests[] = array($file, $expected, $test['yaml'], $test['test']);
67+
$tests[] = array($file, var_export($expected, true), $test['yaml'], $test['test']);
6868
}
6969
}
7070
}

0 commit comments

Comments
 (0)