minor #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 robustfa24749
[Yaml] fix for a HHVM bug
This commit is contained in:
commit
50579442f8
@ -96,7 +96,7 @@ class Cookie
|
|||||||
throw new \UnexpectedValueException(sprintf('The cookie expiration time "%s" is not valid.'), $this->expires);
|
throw new \UnexpectedValueException(sprintf('The cookie expiration time "%s" is not valid.'), $this->expires);
|
||||||
}
|
}
|
||||||
|
|
||||||
$cookie .= '; expires='.substr($dateTime->format(self::$dateFormats[0]), 0, -5);
|
$cookie .= '; expires='.str_replace('+0000', '', $dateTime->format(self::$dateFormats[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('' !== $this->domain) {
|
if ('' !== $this->domain) {
|
||||||
|
@ -304,7 +304,7 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$cookie .= '; expires='.substr(\DateTime::createFromFormat('U', $expires, new \DateTimeZone('UTC'))->format('D, d-M-Y H:i:s T'), 0, -5);
|
$cookie .= '; expires='.str_replace('+0000', '', \DateTime::createFromFormat('U', $expires, new \DateTimeZone('GMT'))->format('D, d-M-Y H:i:s T'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($domain) {
|
if ($domain) {
|
||||||
|
@ -95,7 +95,7 @@ EOF;
|
|||||||
} elseif (isset($test['todo']) && $test['todo']) {
|
} elseif (isset($test['todo']) && $test['todo']) {
|
||||||
// TODO
|
// TODO
|
||||||
} else {
|
} else {
|
||||||
$expected = eval('return '.trim($test['php']).';');
|
eval('$expected = '.trim($test['php']).';');
|
||||||
|
|
||||||
$this->assertEquals($expected, $this->parser->parse($this->dumper->dump($expected, 10)), $test['test']);
|
$this->assertEquals($expected, $this->parser->parse($this->dumper->dump($expected, 10)), $test['test']);
|
||||||
}
|
}
|
||||||
|
@ -62,9 +62,9 @@ class ParserTest extends \PHPUnit_Framework_TestCase
|
|||||||
if (isset($test['todo']) && $test['todo']) {
|
if (isset($test['todo']) && $test['todo']) {
|
||||||
// TODO
|
// TODO
|
||||||
} else {
|
} else {
|
||||||
$expected = var_export(eval('return '.trim($test['php']).';'), true);
|
eval('$expected = '.trim($test['php']).';');
|
||||||
|
|
||||||
$tests[] = array($file, $expected, $test['yaml'], $test['test']);
|
$tests[] = array($file, var_export($expected, true), $test['yaml'], $test['test']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user