This commit is contained in:
Adrien Crivelli 2021-10-31 22:17:07 +09:00
parent 69f633420b
commit c3c93c56d6
No known key found for this signature in database
GPG Key ID: 16D79B903B4B5874
5 changed files with 26 additions and 21 deletions

View File

@ -5757,7 +5757,7 @@ parameters:
- -
message: "#^Parameter \\#2 \\$value of method XMLWriter\\:\\:writeAttribute\\(\\) expects string, string\\|null given\\.$#" message: "#^Parameter \\#2 \\$value of method XMLWriter\\:\\:writeAttribute\\(\\) expects string, string\\|null given\\.$#"
count: 4 count: 5
path: src/PhpSpreadsheet/Writer/Xlsx/StringTable.php path: src/PhpSpreadsheet/Writer/Xlsx/StringTable.php
- -
@ -5852,9 +5852,14 @@ parameters:
- -
message: "#^Parameter \\#2 \\$value of method XMLWriter\\:\\:writeAttribute\\(\\) expects string, string\\|null given\\.$#" message: "#^Parameter \\#2 \\$value of method XMLWriter\\:\\:writeAttribute\\(\\) expects string, string\\|null given\\.$#"
count: 4 count: 9
path: src/PhpSpreadsheet/Writer/Xlsx/Style.php path: src/PhpSpreadsheet/Writer/Xlsx/Style.php
-
message: "#^Parameter \\#2 \\$value of method XMLWriter\\:\\:writeAttribute\\(\\) expects string, string\\|null given\\.$#"
count: 1
path: src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php
- -
message: "#^Parameter \\#2 \\$value of method XMLWriter\\:\\:writeAttribute\\(\\) expects string, float given\\.$#" message: "#^Parameter \\#2 \\$value of method XMLWriter\\:\\:writeAttribute\\(\\) expects string, float given\\.$#"
count: 1 count: 1

View File

@ -56,10 +56,10 @@ class Ods extends BaseReader
$mimeType = $zip->getFromName($stat['name']); $mimeType = $zip->getFromName($stat['name']);
} elseif ($zip->statName('META-INF/manifest.xml')) { } elseif ($zip->statName('META-INF/manifest.xml')) {
$xml = simplexml_load_string( $xml = simplexml_load_string(
$this->securityScanner->scan($zip->getFromName('META-INF/manifest.xml')), $this->securityScanner->scan($zip->getFromName('META-INF/manifest.xml')),
'SimpleXMLElement', 'SimpleXMLElement',
Settings::getLibXmlLoaderOptions() Settings::getLibXmlLoaderOptions()
); );
$namespacesContent = $xml->getNamespaces(true); $namespacesContent = $xml->getNamespaces(true);
if (isset($namespacesContent['manifest'])) { if (isset($namespacesContent['manifest'])) {
$manifest = $xml->children($namespacesContent['manifest']); $manifest = $xml->children($namespacesContent['manifest']);

View File

@ -1154,19 +1154,19 @@ class Xls extends BaseReader
$drawing->setOffsetY($offsetY); $drawing->setOffsetY($offsetY);
switch ($blipType) { switch ($blipType) {
case BSE::BLIPTYPE_JPEG: case BSE::BLIPTYPE_JPEG:
$drawing->setRenderingFunction(MemoryDrawing::RENDERING_JPEG); $drawing->setRenderingFunction(MemoryDrawing::RENDERING_JPEG);
$drawing->setMimeType(MemoryDrawing::MIMETYPE_JPEG); $drawing->setMimeType(MemoryDrawing::MIMETYPE_JPEG);
break; break;
case BSE::BLIPTYPE_PNG: case BSE::BLIPTYPE_PNG:
imagealphablending($ih, false); imagealphablending($ih, false);
imagesavealpha($ih, true); imagesavealpha($ih, true);
$drawing->setRenderingFunction(MemoryDrawing::RENDERING_PNG); $drawing->setRenderingFunction(MemoryDrawing::RENDERING_PNG);
$drawing->setMimeType(MemoryDrawing::MIMETYPE_PNG); $drawing->setMimeType(MemoryDrawing::MIMETYPE_PNG);
break; break;
} }
$drawing->setWorksheet($this->phpSheet); $drawing->setWorksheet($this->phpSheet);
$drawing->setCoordinates($spContainer->getStartCoordinates()); $drawing->setCoordinates($spContainer->getStartCoordinates());

View File

@ -41,7 +41,7 @@ class Color extends Supervisor
/** /**
* ARGB - Alpha RGB. * ARGB - Alpha RGB.
* *
* @var string * @var null|string
*/ */
protected $argb; protected $argb;
@ -135,7 +135,7 @@ class Color extends Supervisor
/** /**
* Get ARGB. * Get ARGB.
*/ */
public function getARGB(): string public function getARGB(): ?string
{ {
if ($this->isSupervisor) { if ($this->isSupervisor) {
return $this->getSharedComponent()->getARGB(); return $this->getSharedComponent()->getARGB();

View File

@ -698,10 +698,10 @@ class Html extends BaseWriter
if ($imageResource) { if ($imageResource) {
ob_start(); // Let's start output buffering. ob_start(); // Let's start output buffering.
imagepng($imageResource); // This will normally output the image, but because of ob_start(), it won't. imagepng($imageResource); // This will normally output the image, but because of ob_start(), it won't.
$contents = ob_get_contents(); // Instead, output above is saved to $contents $contents = ob_get_contents(); // Instead, output above is saved to $contents
ob_end_clean(); // End the output buffer. ob_end_clean(); // End the output buffer.
$dataUri = 'data:image/jpeg;base64,' . base64_encode($contents); $dataUri = 'data:image/jpeg;base64,' . base64_encode($contents);
// Because of the nature of tables, width is more important than height. // Because of the nature of tables, width is more important than height.
// max-width: 100% ensures that image doesnt overflow containing cell // max-width: 100% ensures that image doesnt overflow containing cell
@ -1296,7 +1296,7 @@ class Html extends BaseWriter
} else { } else {
$origData = $this->preCalculateFormulas ? $cell->getCalculatedValue() : $cell->getValue(); $origData = $this->preCalculateFormulas ? $cell->getCalculatedValue() : $cell->getValue();
$formatCode = $worksheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode(); $formatCode = $worksheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode();
if ($formatCode) { if ($formatCode !== null) {
$cellData = NumberFormat::toFormattedString( $cellData = NumberFormat::toFormattedString(
$origData, $origData,
$formatCode, $formatCode,