Skip to content

Commit 84d5633

Browse files
Merge branch '3.1'
* 3.1: (30 commits) Fix merge [HttpFoundation] Use UPSERT for sessions stored in PgSql >= 9.5 [Console] fixed PHPDoc [Cache] Fix double fetch in ProxyAdapter [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 Fixed singular of committee Do not inject web debug toolbar on attachments Fixed issue with legacy client initialization [FrameworkBundle] Remove unused variable bumped Symfony version to 3.0.8 updated VERSION for 3.0.7 ...
2 parents 9fb8e8c + 4b9645f commit 84d5633

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
@@ -484,7 +484,9 @@ public function validateSchema(\DOMDocument $dom)
484484
EOF
485485
;
486486

487+
$disableEntities = libxml_disable_entity_loader(false);
487488
$valid = @$dom->schemaValidateSource($source);
489+
libxml_disable_entity_loader($disableEntities);
488490

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