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\\.$#"
count: 4
count: 5
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\\.$#"
count: 4
count: 9
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\\.$#"
count: 1

View File

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

View File

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

View File

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

View File

@ -698,10 +698,10 @@ class Html extends BaseWriter
if ($imageResource) {
ob_start(); // Let's start output buffering.
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
ob_end_clean(); // End the output buffer.
$contents = ob_get_contents(); // Instead, output above is saved to $contents
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.
// max-width: 100% ensures that image doesnt overflow containing cell
@ -1296,7 +1296,7 @@ class Html extends BaseWriter
} else {
$origData = $this->preCalculateFormulas ? $cell->getCalculatedValue() : $cell->getValue();
$formatCode = $worksheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode();
if ($formatCode) {
if ($formatCode !== null) {
$cellData = NumberFormat::toFormattedString(
$origData,
$formatCode,