Skip to content

Commit 87e9a9e

Browse files
committed
Merge branch '2.6' into 2.7
* 2.6: Extract an AbstractEventDispatcherTest from EventDispatcherTest and also use it in ContainerAwareEventDispatcherTest [SecurityBundle] Authentication entry point is only registered with firewall exception listener, not with authentication listeners be smarter when guessing the document root Azerbaijani locale Fixed grammar error in docblock [HttpKernel] fix parse error in DumpDataCollector [TwigBundle/DebugBundle] move dump extension & cleanups Adjust upgrade file rendering [Bridge/Propel1] Changed deps to accepts all upcoming propel1 versions compare version using PHP_VERSION_ID [Form] Add doc for FormEvents *_timezone changes also affect the BirthdayType don't override internal PHP constants Drop support for model_timezone and view_timezone options in TimeType and DateType. [DomCrawler] Added support for link tags in the Link class [Session] Fix parameter names in WriteCheckSessionHandler Add consistency with request type checking [FrameworkBundle] Fix server run in case the router script does not exist
2 parents 5c38be5 + 318fc2d commit 87e9a9e

File tree

4 files changed

+17
-19
lines changed

4 files changed

+17
-19
lines changed

DataCollector/DumpDataCollector.php

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -155,24 +155,21 @@ public function getDumpsCount()
155155

156156
public function getDumps($format, $maxDepthLimit = -1, $maxItemsPerDepth = -1)
157157
{
158+
$data = fopen('php://memory', 'r+b');
159+
158160
if ('html' === $format) {
159-
$dumper = new HtmlDumper();
161+
$dumper = new HtmlDumper($data);
160162
} else {
161163
throw new \InvalidArgumentException(sprintf('Invalid dump format: %s', $format));
162164
}
163165
$dumps = array();
164166

165167
foreach ($this->data as $dump) {
166-
$data = '';
167-
$dumper->dump(
168-
$dump['data']->getLimitedClone($maxDepthLimit, $maxItemsPerDepth),
169-
function ($line, $depth) use (&$data) {
170-
if (-1 !== $depth) {
171-
$data .= str_repeat(' ', $depth).$line."\n";
172-
}
173-
}
174-
);
175-
$dump['data'] = $data;
168+
$dumper->dump($dump['data']->getLimitedClone($maxDepthLimit, $maxItemsPerDepth));
169+
rewind($data);
170+
$dump['data'] = stream_get_contents($data);
171+
ftruncate($data, 0);
172+
rewind($data);
176173
$dumps[] = $dump;
177174
}
178175

EventListener/SaveSessionListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class SaveSessionListener implements EventSubscriberInterface
4747
{
4848
public function onKernelResponse(FilterResponseEvent $event)
4949
{
50-
if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
50+
if (!$event->isMasterRequest()) {
5151
return;
5252
}
5353

Fragment/HIncludeFragmentRenderer.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111

1212
namespace Symfony\Component\HttpKernel\Fragment;
1313

14-
if (!defined('ENT_SUBSTITUTE')) {
15-
define('ENT_SUBSTITUTE', 8);
16-
}
17-
1814
use Symfony\Component\HttpFoundation\Request;
1915
use Symfony\Component\HttpFoundation\Response;
2016
use Symfony\Component\Templating\EngineInterface;
@@ -111,11 +107,16 @@ public function render($uri, Request $request, array $options = array())
111107
}
112108
$renderedAttributes = '';
113109
if (count($attributes) > 0) {
110+
if (PHP_VERSION_ID >= 50400) {
111+
$flags = ENT_QUOTES | ENT_SUBSTITUTE;
112+
} else {
113+
$flags = ENT_QUOTES;
114+
}
114115
foreach ($attributes as $attribute => $value) {
115116
$renderedAttributes .= sprintf(
116117
' %s="%s"',
117-
htmlspecialchars($attribute, ENT_QUOTES | ENT_SUBSTITUTE, $this->charset, false),
118-
htmlspecialchars($value, ENT_QUOTES | ENT_SUBSTITUTE, $this->charset, false)
118+
htmlspecialchars($attribute, $flags, $this->charset, false),
119+
htmlspecialchars($value, $flags, $this->charset, false)
119120
);
120121
}
121122
}

Tests/Controller/ControllerResolverTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public function testGetArguments()
181181
$request->attributes->set('foobar', 'foobar');
182182
$controller = array(new self(), 'controllerMethod3');
183183

184-
if (version_compare(PHP_VERSION, '5.3.16', '==')) {
184+
if (PHP_VERSION_ID === 50316) {
185185
$this->markTestSkipped('PHP 5.3.16 has a major bug in the Reflection sub-system');
186186
} else {
187187
try {

0 commit comments

Comments
 (0)