Remove unnecessary changes. Added test
This commit is contained in:
parent
c673653c54
commit
559c0761df
|
|
@ -48,7 +48,6 @@ class Xlsx extends BaseReader
|
|||
* @var ReferenceHelper
|
||||
*/
|
||||
private $referenceHelper;
|
||||
|
||||
/**
|
||||
* Xlsx\Theme instance.
|
||||
*
|
||||
|
|
@ -471,10 +470,9 @@ class Xlsx extends BaseReader
|
|||
}
|
||||
|
||||
$xpath = self::getArrayItem($relsWorkbook->xpath("rel:Relationship[@Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles']"));
|
||||
$xpathPath = strpos($xpath['Target'], '/') === 0 ? substr($xpath['Target'], 1) : "$dir/$xpath[Target]";
|
||||
//~ http://schemas.openxmlformats.org/spreadsheetml/2006/main"
|
||||
$xmlStyles = simplexml_load_string(
|
||||
$this->securityScanner->scan($this->getFromZipArchive($zip, $xpathPath)),
|
||||
$this->securityScanner->scan($this->getFromZipArchive($zip, "$dir/$xpath[Target]")),
|
||||
'SimpleXMLElement',
|
||||
Settings::getLibXmlLoaderOptions()
|
||||
);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheetTests\Reader\Xlsx;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Reader\Xlsx;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class AbsolutePathTest extends TestCase
|
||||
{
|
||||
public static function testPr1869(): void
|
||||
{
|
||||
$xlsxFile = 'tests/data/Reader/XLSX/pr1769e.xlsx';
|
||||
$reader = new Xlsx();
|
||||
$result = $reader->listWorksheetInfo($xlsxFile);
|
||||
|
||||
self::assertIsArray($result);
|
||||
self::assertEquals(3, $result[0]['totalRows']);
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Loading…
Reference in New Issue