Skip to content

Commit 7dd8e60

Browse files
Merge branch '2.8' into 3.0
* 2.8: (22 commits) Fix merge [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 [WebProfilerBundle] Fix invalid CSS style Added progressive jpeg to mime types guesser [Yaml] Fix wrong line number when comments are inserted in the middle of a block. Fixed singular of committee Do not inject web debug toolbar on attachments bumped Symfony version to 2.8.8 updated VERSION for 2.8.7 updated CHANGELOG for 2.8.7 bumped Symfony version to 2.7.15 updated VERSION for 2.7.14 update CONTRIBUTORS for 2.7.14 ... Conflicts: CHANGELOG-2.7.md CHANGELOG-3.0.md src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php src/Symfony/Component/HttpKernel/Kernel.php
2 parents 97ae3b8 + d563040 commit 7dd8e60

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

Loader/XmlFileLoader.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,9 @@ public function validateSchema(\DOMDocument $dom)
482482
EOF
483483
;
484484

485+
$disableEntities = libxml_disable_entity_loader(false);
485486
$valid = @$dom->schemaValidateSource($source);
487+
libxml_disable_entity_loader($disableEntities);
486488

487489
foreach ($tmpfiles as $tmpfile) {
488490
@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)