-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Using htmlspecialchars to fix issue #3145: this prevents the SimpleXMLElement error "unterminated entity reference" when HTML entities are present in a worksheet * replace htmlspecialchars with proposal of oleibman * eliminate string cast, because PhpStan has a problem with that * ignore string cast for phpstan + enhance unit test
- Loading branch information
1 parent
c16d86d
commit 3e40532
Showing
3 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace PhpOffice\PhpSpreadsheetTests\Reader\Xlsx; | ||
|
||
use PhpOffice\PhpSpreadsheet\IOFactory; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class Issue3145Test extends TestCase | ||
{ | ||
public function testIssue3145(): void | ||
{ | ||
$filename = 'tests/data/Reader/XLSX/issue.3145.xlsx'; | ||
$reader = IOFactory::createReader('Xlsx'); | ||
$spreadsheet = $reader->load($filename); | ||
$sheet = $spreadsheet->getActiveSheet(); | ||
|
||
self::assertEquals('Headline A', $sheet->getCell('A1')->getValue()); | ||
self::assertEquals('Configdential B', $sheet->getCell('A2')->getValue()); | ||
self::assertSame('OFFSET(INDIRECT(SUBSTITUTE($A2," ","")),0,0,COUNTA(INDIRECT(SUBSTITUTE($A2," ","")&"Col")),1)', $sheet->getCell('B2')->getDataValidation()->getFormula1()); | ||
|
||
$spreadsheet->disconnectWorksheets(); | ||
} | ||
} |
Binary file not shown.