Add UTF-7 XXE Unit test data

This commit is contained in:
MarkBaker 2018-11-19 23:22:59 +01:00
parent a4d97ba896
commit 7a06d71e1c
2 changed files with 5 additions and 2 deletions

View File

@ -3,6 +3,7 @@
namespace PhpOffice\PhpSpreadsheetTests\Reader\Security;
use PHPUnit\Framework\TestCase;
use PhpOffice\PhpSpreadsheet\Reader\Security\XmlScanner;
class XmlScannerTest extends TestCase
{
@ -22,7 +23,7 @@ class XmlScannerTest extends TestCase
public function providerValidXML()
{
$tests = [];
foreach (glob(__DIR__ . '/../../data/Reader/Xml/XEETestValid*.xml') as $file) {
foreach (glob(__DIR__ . '/../../../data/Reader/Xml/XEETestValid*.xml') as $file) {
$tests[basename($file)] = [realpath($file), file_get_contents($file)];
}
@ -48,7 +49,7 @@ class XmlScannerTest extends TestCase
public function providerInvalidXML()
{
$tests = [];
foreach (glob(__DIR__ . '/../../data/Reader/Xml/XEETestInvalidUTF*.xml') as $file) {
foreach (glob(__DIR__ . '/../../../data/Reader/Xml/XEETestInvalidUTF*.xml') as $file) {
$tests[basename($file)] = [realpath($file)];
}

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-7"?>
+ADwAIQ-DOCTYPE xmlrootname +AFsAPAAh-ENTITY +ACU aaa SYSTEM +ACI-http://127.0.0.1:8080/ext.dtd+ACIAPgAl-aaa+ADsAJQ-ccc+ADsAJQ-ddd+ADsAXQA+