Commit Graph

5244 Commits

Author SHA1 Message Date
oleibman 4e7e876b83 Tighten Up getStyle(definedName) Processing 2025-02-16 17:24:17 -08:00
oleibman 7b606243a0 More Apostrophe Fixes
Fix #4362. A similar problem to 4360, Style not handling sheet name with embedded apostrophe properly. And, with two examples in hand, I was able to determine a pattern to find and fix other possible exposures.
2025-02-14 19:40:34 -08:00
oleibman ac148c8d10 Xlsx Reader Defined Name on Sheet with Apostrophe in Title
Fix #4356. Xlsx Reader needs to handle apostrophe for sheet title in defined name by converting doubled apostrophes to single.
2025-02-12 08:05:11 -08:00
oleibman 9d1ad14a48 Merge pull request #4349 from oleibman/updstan
Upgrade Phpstan
2025-02-08 05:02:56 +00:00
oleibman 4bbbbac700 Upgrade Phpstan
Prepatory to switching to "bleeding edge", necessary for Phpstan V2.
2025-02-07 20:58:37 -08:00
oleibman 2d4b9f3582 Merge pull request #4348 from oleibman/chglog20250207
Prepare Changelog for New Release
4.0.0
2025-02-08 02:28:25 +00:00
oleibman f90b6d6799 Setup Suddenly Needs apt-get update 2025-02-07 18:24:16 -08:00
oleibman 5714c8df53 Prepare Changelog for New Release 2025-02-07 17:49:59 -08:00
oleibman 1be70e9036 Merge pull request #4344 from oleibman/parseutf8
Writer/Xls/Parser::advance Should Parse by Character
2025-02-07 16:59:26 +00:00
oleibman cff401544c Merge branch 'master' into parseutf8 2025-02-07 08:56:53 -08:00
oleibman 18cfe5ba7e Merge pull request #4326 from oleibman/serialize
Allow Spreadsheet Serialization
2025-02-07 16:48:05 +00:00
oleibman e58dd89642 Update CHANGELOG.md 2025-02-07 08:43:18 -08:00
oleibman d6892b2733 Merge branch 'master' into serialize 2025-02-07 08:33:24 -08:00
oleibman a432882ea1 Merge pull request #4328 from oleibman/arraysexplicit
Make Explicit Array Return Type When Tests Require It
2025-02-07 06:59:28 +00:00
oleibman 4ad6b32a2b Update CHANGELOG.md 2025-02-06 22:52:14 -08:00
oleibman 4d6db5d1a7 Merge branch 'master' into arraysexplicit 2025-02-06 22:44:41 -08:00
oleibman d0a00803b5 Merge branch 'master' into parseutf8 2025-02-06 17:40:00 -08:00
oleibman ac34f58c0c Writer/Xls/Parser::advance Should Parse by Character
It currently parsed by byte, which is not a good thing in a UTF-8 system. See the discussion at the bottom of PR #4203. That turns out to not be the change which led to this problem; that would have been PR #4323. That change came about because using Composer/Pcre revealed bugs in several regular expressions used in Writer/Xls/Parser. This ticket comes about because more bugs were revealed in the same module. The problem is that the `advance` method needs to process formulas character by character, but is instead doing it byte by byte. It is changed to advance by characters, and tests for non-ASCII characters are added.
2025-02-06 17:37:02 -08:00
oleibman 06f0b4cfb6 Merge pull request #4341 from oleibman/deldeprecate
Remove Previously Announced Deprecations
2025-02-06 06:30:20 +00:00
oleibman 77815d2dcc Remove Previously Announced Deprecations
Remove
- Worksheet::getHashCode
- Worksheet::getProtectecCells
- Worksheet::getStyles
- Drawing::setIsUrl
- IReader::SKIP_EMPTY_CELLS
- Settings:setLibXmlLoaderOptions and getLibXmlLoaderOptions
- Writer/Html::isMpdf
2025-02-04 19:30:57 -08:00
oleibman 65f71583ce Merge pull request #4340 from oleibman/chgdefault
Breaking Change - 3 Defaults
2025-02-05 01:11:04 +00:00
oleibman 6abfe2f626 Merge pull request #4330 from oleibman/removewsstyles
Remove Styles Property From Worksheet
2025-02-05 00:48:19 +00:00
oleibman ed5ea6dd7c Minor Updates To Change Log and Docs 2025-02-04 07:16:03 -08:00
oleibman 95213bf50a Breaking Change - 3 Defaults
Fix #4092. Change default value for Csv Reader autodetect line endings. Prior behavior can be enabled via `setTestAutodetect(true)`.

Change default value for Html Writer "better boolean" logic. Prior behavior can be explicitly enabled via `setBetterBoolean(false)`.

Change default for Xlsx Writer forceFullCalc option. Prior behavior can be explicitly enabled via `setForceFullCalc(null)`.
2025-02-04 06:58:31 -08:00
oleibman eafbed6ca8 Merge pull request #4314 from oleibman/issue4312
CF Priority Property and Overlapping Ranges
2025-02-04 04:35:13 +00:00
oleibman e1ae687a35 Merge pull request #4240 from oleibman/issue797
Breaking Change for DataValidation
2025-02-04 04:31:00 +00:00
oleibman d93a707d37 Update CHANGELOG.md 2025-02-03 20:28:13 -08:00
oleibman cfc8b8c26f Merge branch 'master' into issue797 2025-02-03 17:50:15 -08:00
oleibman e721975cb6 Merge pull request #4333 from oleibman/issue4331
Xls Writer Parser Mis-handling TRUE/FALSE As VLOOKUP Arguments
2025-02-03 00:14:18 +00:00
oleibman 21d8f00c61 Update CHANGELOG.md 2025-02-02 16:11:54 -08:00
oleibman dd600fe621 Merge pull request #4338 from PHPOffice/dependabot/composer/friendsofphp/php-cs-fixer-3.68.5
Bump friendsofphp/php-cs-fixer from 3.66.0 to 3.68.5
2025-02-01 15:43:18 +00:00
oleibman 6523dc7ef0 Merge pull request #4337 from PHPOffice/dependabot/composer/dompdf/dompdf-3.1.0
Bump dompdf/dompdf from 3.0.2 to 3.1.0
2025-02-01 15:42:43 +00:00
oleibman fcc8ade7fe Merge pull request #4336 from PHPOffice/dependabot/composer/tecnickcom/tcpdf-6.8.2
Bump tecnickcom/tcpdf from 6.8.0 to 6.8.2
2025-02-01 15:42:09 +00:00
oleibman a8faaad961 Merge pull request #4335 from PHPOffice/dependabot/composer/squizlabs/php_codesniffer-3.11.3
Bump squizlabs/php_codesniffer from 3.11.2 to 3.11.3
2025-02-01 15:41:40 +00:00
dependabot[bot] 1e4beba5e4 Bump friendsofphp/php-cs-fixer from 3.66.0 to 3.68.5
Bumps [friendsofphp/php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) from 3.66.0 to 3.68.5.
- [Release notes](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases)
- [Changelog](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.66.0...v3.68.5)

---
updated-dependencies:
- dependency-name: friendsofphp/php-cs-fixer
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-01 11:35:11 +00:00
dependabot[bot] 1a9000a649 Bump dompdf/dompdf from 3.0.2 to 3.1.0
Bumps [dompdf/dompdf](https://github.com/dompdf/dompdf) from 3.0.2 to 3.1.0.
- [Release notes](https://github.com/dompdf/dompdf/releases)
- [Commits](https://github.com/dompdf/dompdf/compare/v3.0.2...v3.1.0)

---
updated-dependencies:
- dependency-name: dompdf/dompdf
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-01 11:35:02 +00:00
dependabot[bot] 793075a97e Bump tecnickcom/tcpdf from 6.8.0 to 6.8.2
Bumps [tecnickcom/tcpdf](https://github.com/tecnickcom/TCPDF) from 6.8.0 to 6.8.2.
- [Changelog](https://github.com/tecnickcom/TCPDF/blob/main/CHANGELOG.TXT)
- [Commits](https://github.com/tecnickcom/TCPDF/compare/6.8.0...6.8.2)

---
updated-dependencies:
- dependency-name: tecnickcom/tcpdf
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-01 11:34:58 +00:00
dependabot[bot] ba7976c1cc Bump squizlabs/php_codesniffer from 3.11.2 to 3.11.3
Bumps [squizlabs/php_codesniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) from 3.11.2 to 3.11.3.
- [Release notes](https://github.com/PHPCSStandards/PHP_CodeSniffer/releases)
- [Changelog](https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.11.2...3.11.3)

---
updated-dependencies:
- dependency-name: squizlabs/php_codesniffer
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-01 11:34:55 +00:00
oleibman 4afa7513f5 Merge pull request #4327 from oleibman/pdfchart
Pdf Charts and Drawings
2025-01-30 01:49:10 +00:00
oleibman db8c7689da Update CHANGELOG.md 2025-01-29 17:46:40 -08:00
oleibman 3c02232b2a Merge branch 'master' into pdfchart 2025-01-29 17:40:05 -08:00
oleibman a0f1efea42 Xls Writer Parser Mis-handling TRUE/FALSE As VLOOKUP Arguments
Fix #4331. Parser treats TRUE/FALSE as functions rather than constants, which is nominally harmless, but it then expects an argument count of 0 and instead sees null-string. Changed to recognize this situation and leave TRUE/FALSE/TRUE()/FALSE() unchanged.
2025-01-28 20:24:41 -08:00
oleibman dd8fee52ac Remove Styles Property From Worksheet
Styles are a property of Spreadsheet, not Worksheet. There is a Styles property in Worksheet, initially set to an empty array and *never* updated. This PR removes the property and the getStyles method of Worksheet. This is, technically, a breaking change, so it will be installed with PhpSpreadsheet V4 (PR #4240).
2025-01-27 21:50:05 -08:00
oleibman 414f8a2aa1 Merge pull request #4329 from oleibman/updchglog
Update Changelog
3.9.0
2025-01-26 05:10:24 +00:00
oleibman e4211b7454 Update Changelog 2025-01-25 20:56:52 -08:00
oleibman e637713de9 Make Explicit Array Return Type When Tests Require It
When the Dynamic Array PR #3962 was introduced, it left the default as Return Array as Value. At some point, the default should be changed to Return Array as Array. This would, of course, be a breaking change, one which will not be part of Release 4. However, it will possibly be part of Release 5.

Rather than relying on the default setting, this PR explicitly sets Return Array as Value when tests require that setting. This will make it easier to identify potential breaks when the default is changed. The entire test suite will now succeed with either setting as default.

In making these changes, a few minor problems were discovered with how Array as Array is handled. These are fixed with this PR.
2025-01-25 19:40:12 -08:00
oleibman 4a2b731ec2 Pdf Charts and Drawings
Fix #4129. Fix #4168. Html Writer, which all the Pdf writers use, defines its charts and drawings (henceforth I will just use charts for this discussion) using position:absolute and z-index. Browsers handle this correctly, but none of the Pdf writers do, and I can't think of an alternative method of styling them. The result is that the charts take up too much or too little room on the Pdf.

I suggested in the two discussions that treating the areas covered by the charts as merged cells might mitigate the problem. I think there are too many unknowns to do so automatically (and see next paragraph). However, adding to Spreadsheet new methods `mergeChartCellsForPdf` and `mergeDrawingCellsForPdf` allows the end user to do this if desired. The new methods are exercised for charts in samples/Chart/32_Chart_read_write_PDF, the results of which are much improved as a result. New samples/Pdf/21f_Drawing_mpdf does likewise for drawings.

The new methods alter the spreadsheet they are working on, which could be a problem if you still wish to work with the spreadsheet after writing it to Pdf. In that case, making a copy of the spreadsheet, then calling the new methods on the copy, and writing the copy to Pdf is probably best.
2025-01-25 19:20:37 -08:00
oleibman 8af9963350 Allow Spreadsheet Serialization
Fix #4324. Serialization was explicity forbidden by PR #3199. This was in response to several issues, and concern that the Spreadsheet object contained non-serializable properties. This PR restores the ability to serialize a spreadsheet. Json serialization remains unsupported.

Fix #1757, closed in Nov. 2023 but just reopened. At the time, Cell property `formulaAttributes` was stored as a SimpleXmlElement. Dynamic arrays PR #3962 defined that property as `null|array<string, string>` in the doc block. However, it left the formal Php type for the property as `mixed`. This PR changes the formal type to `?array`.

Fix #1741, closed in Dec. 2020 but just reopened. Calculation property `referenceHelper` was defined as static, and, since static properties don't take part in serialization, this caused a problem after unserialization. There are at least 3 trivial ways to deal with this - make it an instance property, reinitialize it when unserialized using a wakeup method, or remove the property altogether. This PR uses the last of those 3.

Calculation does have other static properties. Almost all of these deal with locale. So serialize/unserialize might wind up using a default locale when non-default is desired (but not necessarily required). If that is a problem for end-users, it will be a new one, and I will work on a solution if and when the time comes.

Static property `returnArrayAsType` is potentially problematic. However, instance property `instanceArrayReturnType` is the preferred method of handling this, and using that will avoid any problems.

Issue #932 also dealt with serialization. I do not have the wherewithal to investigate that issue. If it is not solved by this and the earlier PR's, I will have to leave it to others to re-raise it.

Spreadsheet `copy` is now simplified to use serialize followed by unserialize. Formal tests are added. In addition, I have made a number of informal tests on very complicated spreadsheets, and it has performed correctly for all of them.
2025-01-25 19:13:55 -08:00
oleibman cde2926a9e Merge commit from fork
* Security Patch

Control characters should not be allowed in protocol.

* Tighten Up Drawing

* Fix Test
2025-01-23 21:25:36 -08:00
oleibman 89b30eb41a Merge branch 'master' into issue797 2025-01-21 20:01:25 -08:00