提交的内容
This commit is contained in:
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/CodePage.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/CodePage.php
vendored
Executable file → Normal file
2
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Date.php
vendored
Executable file → Normal file
2
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Date.php
vendored
Executable file → Normal file
@ -184,7 +184,7 @@ class Date
|
||||
throw new Exception("Invalid string $value supplied for datatype Date");
|
||||
}
|
||||
|
||||
if (preg_match('/^\\d\\d:\\d\\d:\\d\\d/', $value) == 1) {
|
||||
if (preg_match('/^\\s*\\d?\\d:\\d\\d(:\\d\\d([.]\\d+)?)?\\s*(am|pm)?\\s*$/i', $value) == 1) {
|
||||
$newValue = fmod($newValue, 1.0);
|
||||
}
|
||||
|
||||
|
||||
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Drawing.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Drawing.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE/Blip.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE/Blip.php
vendored
Executable file → Normal file
16
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/File.php
vendored
Executable file → Normal file
16
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/File.php
vendored
Executable file → Normal file
@ -156,7 +156,11 @@ class File
|
||||
if ($zipMember !== '') {
|
||||
$zipfile = "zip://$filename#$zipMember";
|
||||
if (!self::fileExists($zipfile)) {
|
||||
throw new ReaderException("Could not find zip member $zipfile");
|
||||
// Has the file been saved with Windoze directory separators rather than unix?
|
||||
$zipfile = "zip://$filename#" . str_replace('/', '\\', $zipMember);
|
||||
if (!self::fileExists($zipfile)) {
|
||||
throw new ReaderException("Could not find zip member $zipfile");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -180,6 +184,14 @@ class File
|
||||
return self::validateZipFirst4($filename);
|
||||
}
|
||||
|
||||
return self::fileExists("zip://$filename#$zipMember");
|
||||
$zipfile = "zip://$filename#$zipMember";
|
||||
if (self::fileExists($zipfile)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Has the file been saved with Windoze directory separators rather than unix?
|
||||
$zipfile = "zip://$filename#" . str_replace('/', '\\', $zipMember);
|
||||
|
||||
return self::fileExists($zipfile);
|
||||
}
|
||||
}
|
||||
|
||||
40
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Font.php
vendored
Executable file → Normal file
40
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Font.php
vendored
Executable file → Normal file
@ -380,15 +380,15 @@ class Font
|
||||
$approximate = self::$autoSizeMethod === self::AUTOSIZE_METHOD_APPROX;
|
||||
$columnWidth = 0;
|
||||
if (!$approximate) {
|
||||
$columnWidthAdjust = ceil(
|
||||
self::getTextWidthPixelsExact(
|
||||
str_repeat('n', 1 * (($filterAdjustment ? 3 : 1) + ($indentAdjustment * 2))),
|
||||
$font,
|
||||
0
|
||||
) * 1.07
|
||||
);
|
||||
|
||||
try {
|
||||
$columnWidthAdjust = ceil(
|
||||
self::getTextWidthPixelsExact(
|
||||
str_repeat('n', 1 * (($filterAdjustment ? 3 : 1) + ($indentAdjustment * 2))),
|
||||
$font,
|
||||
0
|
||||
) * 1.07
|
||||
);
|
||||
|
||||
// Width of text in pixels excl. padding
|
||||
// and addition because Excel adds some padding, just use approx width of 'n' glyph
|
||||
$columnWidth = self::getTextWidthPixelsExact($cellText, $font, $rotation) + $columnWidthAdjust;
|
||||
@ -453,29 +453,26 @@ class Font
|
||||
$fontName = $font->getName();
|
||||
$fontSize = $font->getSize();
|
||||
|
||||
// Calculate column width in pixels. We assume fixed glyph width. Result varies with font name and size.
|
||||
// Calculate column width in pixels.
|
||||
// We assume fixed glyph width, but count double for "fullwidth" characters.
|
||||
// Result varies with font name and size.
|
||||
switch ($fontName) {
|
||||
case 'Calibri':
|
||||
// value 8.26 was found via interpolation by inspecting real Excel files with Calibri 11 font.
|
||||
$columnWidth = (int) (8.26 * StringHelper::countCharacters($columnText));
|
||||
$columnWidth = $columnWidth * $fontSize / 11; // extrapolate from font size
|
||||
|
||||
break;
|
||||
case 'Arial':
|
||||
// value 8 was set because of experience in different exports at Arial 10 font.
|
||||
$columnWidth = (int) (8 * StringHelper::countCharacters($columnText));
|
||||
$columnWidth = (int) (8 * StringHelper::countCharactersDbcs($columnText));
|
||||
$columnWidth = $columnWidth * $fontSize / 10; // extrapolate from font size
|
||||
|
||||
break;
|
||||
case 'Verdana':
|
||||
// value 8 was found via interpolation by inspecting real Excel files with Verdana 10 font.
|
||||
$columnWidth = (int) (8 * StringHelper::countCharacters($columnText));
|
||||
$columnWidth = (int) (8 * StringHelper::countCharactersDbcs($columnText));
|
||||
$columnWidth = $columnWidth * $fontSize / 10; // extrapolate from font size
|
||||
|
||||
break;
|
||||
default:
|
||||
// just assume Calibri
|
||||
$columnWidth = (int) (8.26 * StringHelper::countCharacters($columnText));
|
||||
// value 8.26 was found via interpolation by inspecting real Excel files with Calibri 11 font.
|
||||
$columnWidth = (int) (8.26 * StringHelper::countCharactersDbcs($columnText));
|
||||
$columnWidth = $columnWidth * $fontSize / 11; // extrapolate from font size
|
||||
|
||||
break;
|
||||
@ -564,10 +561,13 @@ class Font
|
||||
if (mb_strlen(self::$trueTypeFontPath) > 1 && mb_substr(self::$trueTypeFontPath, -1) !== '/' && mb_substr(self::$trueTypeFontPath, -1) !== '\\') {
|
||||
$separator = DIRECTORY_SEPARATOR;
|
||||
}
|
||||
$fontFile = self::$trueTypeFontPath . $separator . $fontFile;
|
||||
$fontFileAbsolute = preg_match('~^([A-Za-z]:)?[/\\\\]~', $fontFile) === 1;
|
||||
if (!$fontFileAbsolute) {
|
||||
$fontFile = self::$trueTypeFontPath . $separator . $fontFile;
|
||||
}
|
||||
|
||||
// Check if file actually exists
|
||||
if ($checkPath && !file_exists($fontFile)) {
|
||||
if ($checkPath && !file_exists($fontFile) && !$fontFileAbsolute) {
|
||||
$alternateName = $name;
|
||||
if ($index !== 'x' && $fontArray[$name][$index] !== $fontArray[$name]['x']) {
|
||||
// Bold but no italic:
|
||||
|
||||
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/IntOrFloat.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/IntOrFloat.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE.php
vendored
Executable file → Normal file
5
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php
vendored
Executable file → Normal file
5
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php
vendored
Executable file → Normal file
@ -6,6 +6,9 @@ use PhpOffice\PhpSpreadsheet\Shared\OLE;
|
||||
|
||||
class ChainedBlockStream
|
||||
{
|
||||
/** @var mixed */
|
||||
public $context;
|
||||
|
||||
/**
|
||||
* The OLE container of the file that is being read.
|
||||
*
|
||||
@ -160,7 +163,7 @@ class ChainedBlockStream
|
||||
$this->pos = $offset;
|
||||
} elseif ($whence == SEEK_CUR && -$offset <= $this->pos) {
|
||||
$this->pos += $offset;
|
||||
// @phpstan-ignore-next-line
|
||||
// @phpstan-ignore-next-line
|
||||
} elseif ($whence == SEEK_END && -$offset <= count(/** @scrutinizer ignore-type */ $this->data)) {
|
||||
$this->pos = strlen($this->data) + $offset;
|
||||
} else {
|
||||
|
||||
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS/File.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS/File.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php
vendored
Executable file → Normal file
2
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLERead.php
vendored
Executable file → Normal file
2
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLERead.php
vendored
Executable file → Normal file
@ -134,7 +134,7 @@ class OLERead
|
||||
|
||||
$bbdBlocks = $this->numBigBlockDepotBlocks;
|
||||
|
||||
if ($this->numExtensionBlocks != 0) {
|
||||
if ($this->numExtensionBlocks !== 0) {
|
||||
$bbdBlocks = (self::BIG_BLOCK_SIZE - self::BIG_BLOCK_DEPOT_BLOCKS_POS) / 4;
|
||||
}
|
||||
|
||||
|
||||
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/PasswordHasher.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/PasswordHasher.php
vendored
Executable file → Normal file
12
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/StringHelper.php
vendored
Executable file → Normal file
12
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/StringHelper.php
vendored
Executable file → Normal file
@ -451,6 +451,18 @@ class StringHelper
|
||||
return mb_strlen($textValue, $encoding);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get character count using mb_strwidth rather than mb_strlen.
|
||||
*
|
||||
* @param string $encoding Encoding
|
||||
*
|
||||
* @return int Character count
|
||||
*/
|
||||
public static function countCharactersDbcs(string $textValue, string $encoding = 'UTF-8'): int
|
||||
{
|
||||
return mb_strwidth($textValue, $encoding);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a substring of a UTF-8 encoded string.
|
||||
*
|
||||
|
||||
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/TimeZone.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/TimeZone.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/BestFit.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/BestFit.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/ExponentialBestFit.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/ExponentialBestFit.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LinearBestFit.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LinearBestFit.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LogarithmicBestFit.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LogarithmicBestFit.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PowerBestFit.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PowerBestFit.php
vendored
Executable file → Normal file
1
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/Trend.php
vendored
Executable file → Normal file
1
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/Trend.php
vendored
Executable file → Normal file
@ -105,7 +105,6 @@ class Trend
|
||||
$className = '\PhpOffice\PhpSpreadsheet\Shared\Trend\\' . $trendType . 'BestFit';
|
||||
//* @phpstan-ignore-next-line
|
||||
$bestFit[$trendMethod] = new $className($yValues, $xValues, $const);
|
||||
//* @phpstan-ignore-next-line
|
||||
$bestFitValue[$trendMethod] = $bestFit[$trendMethod]->getGoodnessOfFit();
|
||||
}
|
||||
if ($trendType != self::TREND_BEST_FIT_NO_POLY) {
|
||||
|
||||
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/XMLWriter.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/XMLWriter.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Xls.php
vendored
Executable file → Normal file
0
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Xls.php
vendored
Executable file → Normal file
Reference in New Issue
Block a user