mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-12 02:56:44 +00:00
Delete Temporary Files In XssVulnerabilityTest (#1800)
* Delete Temporary Files In XssVulnerabilityTest They need not exist after the test. Some of them are placed in current directory, which means Git thinks they are needed.
This commit is contained in:
@@ -43,6 +43,7 @@ class XssVulnerabilityTest extends Functional\AbstractFunctional
|
||||
$writer->save($filename);
|
||||
|
||||
$verify = file_get_contents($filename);
|
||||
unlink($filename);
|
||||
// Ensure that executable js has been stripped from the comments
|
||||
self::assertStringContainsString($adjustedTextString, $verify);
|
||||
}
|
||||
@@ -58,8 +59,6 @@ class XssVulnerabilityTest extends Functional\AbstractFunctional
|
||||
];
|
||||
}
|
||||
|
||||
private static $counter = 0;
|
||||
|
||||
/**
|
||||
* @dataProvider providerXssRichText
|
||||
*
|
||||
@@ -84,8 +83,7 @@ class XssVulnerabilityTest extends Functional\AbstractFunctional
|
||||
$writer->save($filename);
|
||||
|
||||
$verify = file_get_contents($filename);
|
||||
$counter = self::$counter++;
|
||||
file_put_contents("verify{$counter}.html", $verify);
|
||||
unlink($filename);
|
||||
// Ensure that executable js has been stripped from the comments
|
||||
self::assertStringNotContainsString($xssTextString, $verify);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user