['Hello, I am safely viewing your site', 'Hello, I am safely viewing your site'],
'link eliminated' => ["Google is here", "<a href='Visit Google'>Google is here</a>"],
'script tag' => ["Hello, I am trying to your site", "Hello, I am trying to <script>alert('Hack');</script> your site"],
'script tag with quotes' => ['Hello, I am trying to your site', 'Hello, I am trying to <script>alert("Hack");</script> your site'],
'javascript tag no hex' => ["CLICK", "<a href='javascript:alert(1)'>CLICK</a>"],
'javascript tag' => ["CLICK", "<a href=' javascript:alert(1)'>CLICK</a>"],
'with unicode' => ['CLICK', '<a href="\u0001java\u0003script:alert(1)">CLICK</a>'],
'inline css' => ['
' . $eol . $endCell;
}
$verify = $writer->generateHtmlAll();
// Ensure that executable js has been stripped from the comments
self::assertStringContainsString($expected, $verify);
$spreadsheet->disconnectWorksheets();
}
public function testXssInFontName(): void
{
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
$sheet->getCell('A1')->setValue('here');
$used = 'Calibri