Commit Graph

4751 Commits

Author SHA1 Message Date
oleibman 4da01c3084 Merge pull request #4111 from oleibman/issue4108
Parameter Name Change Xlsx Writer Workbook
2024-08-01 21:10:16 +00:00
oleibman 3e5f1fec40 Merge branch 'master' into issue4108 2024-08-01 14:07:12 -07:00
oleibman a157e3fe7f Update CHANGELOG.md 2024-08-01 14:04:20 -07:00
oleibman 0ddaff3a21 Update Workbook.php 2024-08-01 11:59:28 -07:00
oleibman fcca8ac3cf Merge pull request #4123 from oleibman/csfixer20240801
Php-cs-fixer Enforcing New Rules
2024-08-01 18:18:33 +00:00
oleibman bbf9d15cb2 Php-cs-fixer Enforcing New Rules
The latest release seems to not want you to give a class element both a Php type and a doc-block type. I used the "fix" operand to delete the redundant doc-block declarations, with no other changes. So there should be no change to executable code.
2024-08-01 10:54:54 -07:00
oleibman 3b150557ad Merge pull request #4120 from oleibman/changelog300again
Prepare Changelog for 3.0
2024-07-31 05:39:02 +00:00
oleibman 7556b12b1b Prepare Changelog for 3.0
Also upgrade vendor modules a day ahead of Dependabot.
2024-07-30 22:22:22 -07:00
oleibman 523afe57f0 Merge pull request #4107 from oleibman/pr848
RATE Function Permits Floating Point NPER
2024-07-30 22:05:12 +00:00
oleibman ae2c3ea5e4 Merge pull request #4106 from oleibman/issue1284
Html Reader Preserve Unicode Whitespace Characters
2024-07-30 22:04:10 +00:00
Adrien Crivelli a3c5c9e7ce 2.2.1 2.2.1 2024-07-29 16:56:06 +09:00
Adrien Crivelli ea97c17bca Merge pull request #4119 from PHPOffice/powerkiki
Security: prevent XXE (XML External Entity) when loading files
2024-07-29 07:50:39 +00:00
Adrien Crivelli bea2d4b30f Security: prevent XXE (XML External Entity) when loading files
Prevent XEE by hiding custom entities by using single quote to
declare a non-UTF-8 encoding.

XML standard, https://www.w3.org/TR/xml/#NT-EncodingDecl, allows single
quote to declare encoding, but we did not support it. Instead, we
incorrectly fell back on the default of UTF-8. That incorrectly kept the
XML as non-UTF-8, and thus prevented our regexp-based custom entity
detection mechanism to work.
2024-07-29 16:22:43 +09:00
oleibman b43947f4c9 Merge pull request #4101 from oleibman/issue4099
Ods Reader Allow Omission of Some Page Settings Tags
2024-07-27 14:51:24 +00:00
oleibman debb1776ef Update CHANGELOG.md 2024-07-27 07:48:40 -07:00
oleibman ab5965affb Merge branch 'master' into issue4099 2024-07-27 07:36:13 -07:00
oleibman 8225096c6f Merge pull request #4098 from oleibman/issue912
Xlsx Reader and Print/Show Gridlines
2024-07-27 14:27:18 +00:00
oleibman bf0281be34 Merge pull request #4096 from oleibman/issue296
Reference to Defined Name Specifying Worksheet Name
2024-07-27 14:25:50 +00:00
oleibman 64b02b0bc1 Merge pull request #4114 from oleibman/issue4112
Addsheet May Leave Active Sheet Uninitialized
2024-07-27 06:27:53 +00:00
oleibman 459f442b9e Additional Test
New test testGifIssue4112 uses the same technique as reported in the original issue, and it would fail on all PhpSpreadsheet releases, not just 2.2.0.
2024-07-26 11:52:35 -07:00
oleibman 1df4b17d55 Scrutinizer Found a Real Problem
My test was imperfect,and Scrutinizer detected it.
2024-07-26 08:53:00 -07:00
oleibman 762d73daf5 Addsheet May Leave Active Sheet Uninitialized
Fix #4112. Direct cause is that `applyStylesFromArray` tries to save and restore `activeSheetIndex`. However, if activeSheetIndex is -1, indicating no active sheet, the restore should not be attempted. Code is changed to test before attempting to restore.

The actual problem, however, is that user specified a sheet number for `addSheet`. That method will set activeSheetIndex most of the time, but this was a gap - when the supplied sheet number (0 in this case) is greater than activeSheetIndex (-1 in this case), it was leaving activeSheetIndex as -1. It is changed to set activeSheetIndex to 0 when activeSheetIndex is negative.
2024-07-26 08:30:52 -07:00
oleibman 4db909c7bb Parameter Name Change Xlsx Writer Workbook
See issue #4108. Parameter recalcRequired is a complete misnomer. While we can get along without changing it, I think we should strive for accuracy. Execution logic is unchanged, and existing tests are adequate. This isn't really intended as a public interface, and, even if is being used by someone out there, it will be a problem only for people calling the parameter by name. So the chances of a problem are very low, and the workaround is very easy (call positionally).
2024-07-25 16:57:10 -07:00
oleibman b406367425 Merge pull request #4110 from oleibman/changelog300prep
Prepare Changelog For Next Release
2024-07-24 14:13:04 +00:00
oleibman b86629ff58 Prepare Changelog For Next Release 2024-07-24 07:08:44 -07:00
oleibman b0993b7e4d Merge pull request #4109 from oleibman/changelog220
Changelog Prep for 2.2.0
2.2.0
2024-07-24 13:21:18 +00:00
oleibman 10823ee00a Changelog Prep for 2.2.0 2024-07-24 01:15:11 -07:00
oleibman b6ff857ba7 RATE Function Permits Floating Point NPER
Suggested by PR #848 from @markkimsal. The RATE calculation had already been corrected, so that part of the PR was unnecessary, however one of the tests included a floating point value for Number of Periods, which Excel permits. PhpSpreadsheet till now expected that parameter to be an integer. This is trivially changed with some tests added.
2024-07-22 08:32:54 -07:00
oleibman 09584d2950 Html Reader Preserve Unicode Whitespace Characters
Fix #1284, which was closed as stale in 2019, but which I will now reopen. Html Reader converts *Unicode* whitespace characters in a DOM text node to space. However, Html treats only space, tab, CR, LF, vertical tab, and form-feed as whitespace. Using a regular expression with the `u` (Unicode) modifier causes a number of other characters to be converted to space inappropriately. The issue mentions "ideographic space" in particular, stating that it is used for formatting and should be preserved. "Non-breaking space" is also used in the same way and should also be preserved. An exception is made for a text node consisting of a single non-breaking space, since that is used as a placeholder by Html Writer; my own guess is that this is the reason why the Unicode modifier was used in the first place.
2024-07-21 19:48:40 -07:00
oleibman 2952cf5526 Ods Reader Allow Omission of Some Page Settings Tags
Fix #4099. Ods Reader was expecting there to always be `header-style` and `footer-style` tags when `page-layout` tag is present, but these need not exist. It seemed like there might be other exposures along this line in `readPageSettingStyles`; rather than waiting for a problem report to show up for each, the code is updated to use `->item(0)` in place of `[0]` when appropriate, and make use of the nullsafe `?->` operator introduced with Php8.
2024-07-18 13:30:58 -07:00
oleibman fcf03b95bf Merge pull request #4094 from oleibman/issue476
Xlsx Writer Rich Text and TYPE_STRING
2024-07-18 00:45:06 +00:00
oleibman 73eeba0f1b Merge branch 'master' into issue476 2024-07-17 17:42:28 -07:00
oleibman d76481f668 Update CHANGELOG.md 2024-07-17 17:41:14 -07:00
oleibman f4ef625fdb Merge pull request #4093 from oleibman/issue460
Ods Boolean Data
2024-07-17 23:29:35 +00:00
oleibman f632732564 Scrutinizer Busy Work 2024-07-17 10:45:56 -07:00
oleibman 2a0090b915 Xlsx Reader and Print/Show Gridlines
Fix #912, opened in Feb. 2019, and closed as stale in Apr. 2019, and which I have re-opened to be closed properly by this PR. Another "better late than never". Original issue says that print options should not affect ShowGridlines, which seems true enough. Aside from that, the existing code isn't quite correct anyhow. Excel looks for 2 attributes, one of which must be explicitly set to true and the other of which must not be explicitly set to false, in order to determine whether PrintGridlines should be set. PhpSpreadsheet is changed to do the same. This could be treated as a BC break for the unusual situation described in the issue, but it seems more like a bug fix to me.
2024-07-17 09:28:35 -07:00
oleibman 1c333d1f3d Reference to Defined Name Specifying Worksheet Name
Fix #296, another entry in our magical history tour (closed as stale in 2018). Excel allows you to use a name defined on another worksheet by prefixing the sheet name, even when the scope of the defined name is its worksheet rather than the entire workbook.
2024-07-15 22:17:09 -07:00
oleibman 88908a8a03 Merge pull request #4089 from oleibman/issue1515minor
Html Writer Minor Fixes
2024-07-12 16:31:53 +00:00
oleibman 6c1a2e5695 Merge branch 'master' into issue1515minor 2024-07-12 09:29:15 -07:00
oleibman ed677fe6e9 Update CHANGELOG.md 2024-07-12 09:28:23 -07:00
oleibman c196847841 Merge pull request #4088 from oleibman/issue64
Changes to INDEX Function
2024-07-12 03:42:58 +00:00
oleibman 59dfd1f20d Merge branch 'master' into issue64 2024-07-11 20:39:49 -07:00
oleibman 9652ffe73a Update CHANGELOG.md 2024-07-11 20:38:22 -07:00
oleibman 6ab27d2931 Xlsx Writer Rich Text and TYPE_STRING
Fix #476. Another in the "better late than never" series, closed as stale in June 2018. Xlsx Writer expects cells containing RichText to have DataType `TYPE_INLINE`; but the spreadsheet associated with the issue has the cell defined as `TYPE_STRING`. Change Writer to handle RichText TYPE_STRING appropriately.
2024-07-11 20:05:16 -07:00
oleibman 18e3c00e40 Performance Improvements for Csv Reader
Fix #460. Another in the "better late than never" series, closed as stale in June 2018. Ods Writer and Ods Reader handle booleans differently; what is worse, neither of them do it correctly. They will now match the behavior of LibreOffice. Reporter said that part of the xml would vary depending on locale; I believe that part is never actually used, but I do emulate that behavior.
2024-07-11 19:48:12 -07:00
oleibman 6c1b00b6f9 Merge pull request #4087 from oleibman/issue804
Ods Xml Reader and Whitespace Text Nodes
2024-07-11 03:17:28 +00:00
oleibman 2c150d5381 Merge branch 'master' into issue804 2024-07-10 20:14:46 -07:00
oleibman f6f155263c Update CHANGELOG.md 2024-07-10 20:13:50 -07:00
oleibman ca41de3b23 Merge pull request #4086 from oleibman/issue4081
Ods Comments With Newlines
2024-07-07 14:32:24 +00:00
oleibman 96f09441ca Merge branch 'master' into issue4081 2024-07-07 07:27:49 -07:00