Skip to content

Commit d563040

Browse files
Merge branch '2.7' into 2.8
* 2.7: [HttpFoundation] Use UPSERT for sessions stored in PgSql >= 9.5 [Console] fixed PHPDoc [travis] HHVM 3.12 LTS Fix feature detection for IE [Form] Fixed collapsed choice attributes [Console] added explanation of messages usage in a progress bar force enabling the external XML entity loaders [Yaml] properly count skipped comment lines Conflicts: src/Symfony/Component/Translation/Loader/XliffFileLoader.php
2 parents 2d05009 + 8b8716d commit d563040

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

Loader/XmlFileLoader.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,6 @@ private function processAnonymousServices(\DOMDocument $xml, $file)
338338
foreach ($definitions as $id => $def) {
339339
list($domElement, $file, $wild) = $def;
340340

341-
342341
if (null !== $definition = $this->parseDefinition($domElement, $file)) {
343342
$this->container->setDefinition($id, $definition);
344343
}
@@ -508,7 +507,9 @@ public function validateSchema(\DOMDocument $dom)
508507
EOF
509508
;
510509

510+
$disableEntities = libxml_disable_entity_loader(false);
511511
$valid = @$dom->schemaValidateSource($source);
512+
libxml_disable_entity_loader($disableEntities);
512513

513514
foreach ($tmpfiles as $tmpfile) {
514515
@unlink($tmpfile);

Tests/Loader/XmlFileLoaderTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,19 @@ public function testParseFile()
8484
$this->assertInstanceOf('DOMDocument', $xml, '->parseFileToDOM() returns an SimpleXMLElement object');
8585
}
8686

87+
public function testLoadWithExternalEntitiesDisabled()
88+
{
89+
$disableEntities = libxml_disable_entity_loader(true);
90+
91+
$containerBuilder = new ContainerBuilder();
92+
$loader = new XmlFileLoader($containerBuilder, new FileLocator(self::$fixturesPath.'/xml'));
93+
$loader->load('services2.xml');
94+
95+
libxml_disable_entity_loader($disableEntities);
96+
97+
$this->assertTrue(count($containerBuilder->getParameterBag()->all()) > 0, 'Parameters can be read from the config file.');
98+
}
99+
87100
public function testLoadParameters()
88101
{
89102
$container = new ContainerBuilder();

0 commit comments

Comments
 (0)