Skip to content

Commit

Permalink
Allow warnings for Xml entities.
Browse files Browse the repository at this point in the history
For some installations libxml_use_internal_errors() does not work,
a warning is another way to measure the entities not being loaded.
  • Loading branch information
markstory committed Jul 14, 2012
1 parent 418672f commit e218738
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/Cake/Test/Case/Utility/XmlTest.php
Expand Up @@ -1049,8 +1049,12 @@ public function testNoEntityLoading() {
<xxe>&payload;</xxe>
</request>
XML;
$result = Xml::build($xml);
$this->assertEquals('', (string)$result->xxe);
try {
$result = Xml::build($xml);
$this->assertEquals('', (string)$result->xxe);
} catch (Exception $e) {
$this->assertTrue(true, 'A warning was raised meaning external entities were not loaded');
}
}

}

0 comments on commit e218738

Please sign in to comment.