Skip to content

Inherited Scrutinizer Recommendations - 1 of 3 #1806

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 40 commits into from
Jan 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
52f3005
Make DefinedNames Samples Consistent With Other Samples (#1707)
oleibman Nov 11, 2020
e05442b
Resolve XSS Vulnerability in the HTML Writer (#1719)
Nov 19, 2020
5596d6d
Drop Travis
PowerKiKi Nov 26, 2020
d75bba4
Automatic GitHub releases from git tags
PowerKiKi Nov 26, 2020
e4be949
Improve Coverage in src/PhpSpreadsheet
oleibman Nov 27, 2020
39025e8
Changes for Scrutinizer
oleibman Nov 27, 2020
6e71f80
Spelling: Tou -> You
rhynodesigns Dec 7, 2020
95cb746
Fix for 1735 (Incorrect activeSheetIndex after RemoveSheetByIndex) (#…
oleibman Dec 10, 2020
37ec4fa
Update change log
Dec 10, 2020
7b8f023
Fix for 3 Issues Involving ReadXlsx and NamedRange (#1742)
oleibman Dec 10, 2020
acd5a75
Update change log
Dec 10, 2020
cf30b88
Apply Column and Row Styles to Existing Cells (#1721)
oleibman Dec 10, 2020
ebae8ef
Update change log
Dec 10, 2020
2cbe2fd
TextData Coverage and Minor Bug Fixes (#1744)
oleibman Dec 10, 2020
a4bd396
Replace anti-xss with html purifier (#1751)
Dec 10, 2020
dfc0ff4
Fix bug #1626 where values of 0 were "rounded" up/down as if they wer…
Flinsch Dec 10, 2020
0ad58e6
Update change log
Dec 10, 2020
201817c
Fix for #1612 - SLK Long File Name (#1706)
oleibman Dec 10, 2020
5079aac
Update change log
Dec 10, 2020
6e56c2c
worksheet: fix if cellValue does not exist (#1727)
jasverix Dec 10, 2020
be3b30b
fixes #1655 issue (#1656)
kalyabin Dec 10, 2020
fe45f08
Add 'ps' suffix to printer settings resources IDs (#1690)
sdespont Dec 10, 2020
b2b1f25
Update change log
Dec 10, 2020
64a22e0
Fix pixelsToPoints conversion (for HTML col width) (#1733)
guilliamxavier Dec 10, 2020
f011d1f
DocBlock Change in Styles/Conditional (#1697)
oleibman Dec 10, 2020
c1a63d7
Merge pull request #1698
oleibman Dec 17, 2020
65b8625
Fix for bug #1592 (UPDATED) (#1623)
ggiovinazzo Dec 17, 2020
09b9771
Update change log
Dec 17, 2020
99e023f
Add nightly PHP 8.1 dev to github actions (#1763)
Dec 21, 2020
a70c1eb
Fix compatibility with ext-gd on php 8 (#1762)
derrabus Dec 25, 2020
b691443
CSV - Guess Encoding, Handle Null-string Escape (#1717)
oleibman Dec 25, 2020
a46032b
Update changelog
Dec 25, 2020
bad8647
Update Units of Measure supported by the CONVERT() function (#1768)
Dec 29, 2020
3998509
Changelog for 1.16.0 release
Dec 31, 2020
c6074ab
Fix date tests withut specified year for current year 2021 (#1774)
martinssipenko Jan 7, 2021
298dd1e
Mrand of zero to any multiple should return 0 (#1773)
martinssipenko Jan 7, 2021
e51ea11
Merge pull request #6 from PHPOffice/master
oleibman Jan 18, 2021
c975e23
WIP Inherited Scrutinizer Recommendations - 1 of 3
oleibman Jan 25, 2021
f2292c1
Try Hyperlink Again
oleibman Jan 25, 2021
cacd9f9
Another Crack at Hyperlink
oleibman Jan 25, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/PhpSpreadsheet/Reader/Csv.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ private function openFileOrMemory($pFilename): void
public function loadIntoExisting($pFilename, Spreadsheet $spreadsheet)
{
$lineEnding = ini_get('auto_detect_line_endings');
ini_set('auto_detect_line_endings', true);
ini_set('auto_detect_line_endings', '1');

// Open file
$this->openFileOrMemory($pFilename);
Expand Down Expand Up @@ -528,7 +528,8 @@ public function canRead($pFilename)
fclose($this->fileHandle);

// Trust file extension if any
$extension = strtolower(pathinfo($pFilename, PATHINFO_EXTENSION));
$extension = pathinfo($pFilename, PATHINFO_EXTENSION);
$extension = is_array($extension) ? '' : strtolower($extension);
if (in_array($extension, ['csv', 'tsv'])) {
return true;
}
Expand Down
3 changes: 1 addition & 2 deletions src/PhpSpreadsheet/Reader/Xlsx.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,7 @@ public function listWorksheetInfo($pFilename)
);
if ($xmlWorkbook->sheets) {
$dir = dirname($rel['Target']);
/** @var SimpleXMLElement $eleSheet */
foreach ($xmlWorkbook->sheets->sheet as $eleSheet) {
foreach ($xmlWorkbook->sheets->sheet->children() as $eleSheet) {
$tmpInfo = [
'worksheetName' => (string) $eleSheet['name'],
'lastColumnLetter' => 'A',
Expand Down
4 changes: 3 additions & 1 deletion src/PhpSpreadsheet/Reader/Xlsx/Hyperlinks.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ public function readHyperlinks(SimpleXMLElement $relsWorksheet): void
public function setHyperlinks(SimpleXMLElement $worksheetXml): void
{
foreach ($worksheetXml->hyperlink as $hyperlink) {
$this->setHyperlink($hyperlink, $this->worksheet);
if ($hyperlink !== null) {
$this->setHyperlink($hyperlink, $this->worksheet);
}
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/PhpSpreadsheet/Spreadsheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,9 @@ public function setUnparsedLoadedData(array $unparsedLoadedData): void
*/
private function getExtensionOnly($path)
{
return pathinfo($path, PATHINFO_EXTENSION);
$extension = pathinfo($path, PATHINFO_EXTENSION);

return is_array($extension) ? '' : $extension;
}

/**
Expand Down