Commit Graph

4549 Commits

Author SHA1 Message Date
dependabot[bot] 0543c1ff8d Bump tecnickcom/tcpdf from 6.7.4 to 6.7.5
Bumps [tecnickcom/tcpdf](https://github.com/tecnickcom/TCPDF) from 6.7.4 to 6.7.5.
- [Changelog](https://github.com/tecnickcom/TCPDF/blob/main/CHANGELOG.TXT)
- [Commits](https://github.com/tecnickcom/TCPDF/compare/6.7.4...6.7.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-01 11:42:11 +00:00
oleibman 34272571f5 Merge pull request #3992 from oleibman/issue3988
Table Filter Buttons
2024-04-20 14:32:03 +00:00
oleibman 98ab11cf5f Table Filter Buttons
Fix #3988. Excel allows a table to have some colums with filter buttons exposed and some with filter buttons hidden. However you cannot do this in "native" Excel - VBA is required for this feature. PhpSpreadsheet is supposed to be able to handle this, but Xlsx/Writer/Table had a bug. The `filterColumn` tags in the xml should be children of the `autoFilter` tag, but were generated as siblings. Moving one statement fixes that problem. Fixing that exposed another problem - autoFilter `showHideRows` was not properly recognizing that a filter could exist without any rules, which is what happens when a table filter button is hidden. Another simple change fixes that problem.

The parent issue correctly points out the problem for Column D in samples/Table/01_Table. However, that sample also has a problem with Column A - unlike columns B and C, there is a filter appled to column A, so its dropdown button should appear different than those in B and C. That problem is also corrected with the fixes above. I also added some formal tests based on that sample.
2024-04-17 10:45:58 -07:00
oleibman e9f03dfe36 Merge pull request #3946 from Phenix789/master
Fix default value for Conditional::$text
2024-04-17 02:27:33 +00:00
oleibman c84bdbf015 Add Test Case 2024-04-16 19:18:40 -07:00
oleibman 35030fa66d Merge pull request #3973 from Chris53897/patch-2
chore: fix ci deprcation (github pages)
2024-04-15 00:36:53 +00:00
oleibman a6b0405906 Merge pull request #3972 from Chris53897/patch-1
chore: fix ci deprecations
2024-04-15 00:36:30 +00:00
oleibman b732e55b61 Merge pull request #3984 from PHPOffice/dependabot/composer/friendsofphp/php-cs-fixer-3.53.0
Bump friendsofphp/php-cs-fixer from 3.51.0 to 3.53.0
2024-04-15 00:35:54 +00:00
oleibman df26a76a30 Update FunctionPrefix.php 2024-04-14 17:23:41 -07:00
dependabot[bot] 9c502b7d02 Bump friendsofphp/php-cs-fixer from 3.51.0 to 3.53.0
Bumps [friendsofphp/php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) from 3.51.0 to 3.53.0.
- [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.51.0...v3.53.0)

---
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>
2024-04-15 00:23:24 +00:00
oleibman a076cfd00b Merge pull request #3970 from PHPOffice/dependabot/composer/squizlabs/php_codesniffer-3.9.1
Bump squizlabs/php_codesniffer from 3.9.0 to 3.9.1
2024-04-15 00:20:59 +00:00
oleibman 350162c938 Merge pull request #3971 from PHPOffice/dependabot/composer/mpdf/mpdf-8.2.3
Bump mpdf/mpdf from 8.2.2 to 8.2.3
2024-04-15 00:09:57 +00:00
oleibman 5748f3fe62 Merge pull request #3983 from PHPOffice/dependabot/composer/phpunit/phpunit-9.6.19
Bump phpunit/phpunit from 9.6.17 to 9.6.19
2024-04-15 00:08:39 +00:00
oleibman 0c0040840d Merge pull request #3966 from PHPOffice/dependabot/composer/phpstan/phpstan-1.10.66
Bump phpstan/phpstan from 1.10.59 to 1.10.66
2024-04-15 00:08:09 +00:00
oleibman e401743465 Merge pull request #3967 from PHPOffice/dependabot/composer/tecnickcom/tcpdf-6.7.4
Bump tecnickcom/tcpdf from 6.6.5 to 6.7.4
2024-04-14 23:35:38 +00:00
dependabot[bot] 40ccfb9b65 Bump phpunit/phpunit from 9.6.17 to 9.6.19
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.6.17 to 9.6.19.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/9.6.19/ChangeLog-9.6.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/9.6.17...9.6.19)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-14 23:29:32 +00:00
dependabot[bot] 419806484a Bump phpstan/phpstan from 1.10.59 to 1.10.66
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.59 to 1.10.66.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.11.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.10.59...1.10.66)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-14 23:29:25 +00:00
oleibman f7cf378fae Merge pull request #3957 from oleibman/htmlcomments
Html Writer Comments - Breaking Change
2024-04-14 23:24:47 +00:00
chris 8809fe1dd4 chore: fix ci deprcation (github pages) 2024-04-04 14:18:32 +02:00
chris 433b154764 chore: fix ci deprecations 2024-04-04 14:17:01 +02:00
dependabot[bot] 44accfd2d7 Bump mpdf/mpdf from 8.2.2 to 8.2.3
Bumps [mpdf/mpdf](https://github.com/mpdf/mpdf) from 8.2.2 to 8.2.3.
- [Release notes](https://github.com/mpdf/mpdf/releases)
- [Changelog](https://github.com/mpdf/mpdf/blob/development/CHANGELOG.md)
- [Commits](https://github.com/mpdf/mpdf/compare/v8.2.2...v8.2.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-01 11:35:37 +00:00
dependabot[bot] 377895b965 Bump squizlabs/php_codesniffer from 3.9.0 to 3.9.1
Bumps [squizlabs/php_codesniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) from 3.9.0 to 3.9.1.
- [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.9.0...3.9.1)

---
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>
2024-04-01 11:35:33 +00:00
dependabot[bot] dac6c93295 Bump tecnickcom/tcpdf from 6.6.5 to 6.7.4
Bumps [tecnickcom/tcpdf](https://github.com/tecnickcom/TCPDF) from 6.6.5 to 6.7.4.
- [Changelog](https://github.com/tecnickcom/TCPDF/blob/main/CHANGELOG.TXT)
- [Commits](https://github.com/tecnickcom/TCPDF/commits/6.7.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-01 11:35:17 +00:00
oleibman f20688c179 Typo In Previous PR 2024-03-27 14:06:34 -07:00
oleibman c695d5ca8b Minor Correction
Sanitize font name.
2024-03-27 14:01:13 -07:00
oleibman e63e8a9bbf Merge pull request #3959 from oleibman/docrector
Update Rector Documentation
2024-03-25 02:22:10 +00:00
oleibman 6208887c12 Update Rector Documentation
Rector no longer supports conversion from PhpExcel (issue #3953). Documentation is updated to suggest using a non-current release of Rector for conversion.
2024-03-24 19:17:22 -07:00
oleibman 016ad4810e Merge pull request #3956 from oleibman/issue3951
Protect Sheet But Allow Sort
2024-03-25 00:55:00 +00:00
oleibman 6b09ee96b8 Update CHANGELOG.md 2024-03-24 17:50:26 -07:00
oleibman f64e0ecd79 Merge branch 'master' into issue3951 2024-03-24 17:40:54 -07:00
oleibman a9ac138300 Migration Aid
Provide a means for potentially affected users to test if new logic is in effect so that they can update code beforehand.
2024-03-21 08:53:13 -07:00
oleibman 989a4cec54 Html Writer Comments - Breaking Change
Fix #3954. In response to a Security Incident, a package was added to the project to sanitize the Html for comments attached to a cell. We have tried at least 2 different packages for this purpose, and users have raised legitimate concerns about both.

I believe that adding a sanitizer package, although it addresses the problem, was overkill. Cell comments are a RichText object, and Html Writer already handled RichText cell *values*. Values did not figure in the Incident, and they surely would have done so if they were a problem because it is a lot easier to set up test cases for values than for comments. RichText values were not a problem because they were sanitized with `htmlspecialchars`; if comments were to use the same code that RichText was already using, it would likewise be safely sanitized. As an added bonus, the existing code for comments only uses the plaintext value, but the values code would allow the comments to be styled, just as they are for Xlsx.

This is a breaking change - I don't think it will affect a lot of users, but there may be some. It is worth noting that the comment block before function `writeComment` has a link explaining what is being done. That link mentions only styling elements, not other possibilities like hyperlinks. At any rate, if people are putting styling tags (e.g. `<b>`) in their comments for this purpose, those will no longer work; the styling needs to be applied to the RichText elements. That will keep the user code the same regardless of the format of the intended output, which is certainly a good thing, but it is a break. If people are trying to insert non-styling tage (e.g. `<a>`), those will no longer work, just as there is no way to do it for Xlsx (although Excel itself may convert the raw text to a hyperlink, but that's out of scope, at least for now). I also note that, even with the current code, I haven't yet found a way to keep the Html comment in place long enough to actually click on any hyperlinks.

The main package being dropped brings several other packages along with it, so the project as a whole will have a slightly lighter footprint than before.

The existing `XssVulnerability` test cases are all preserved. Although the final result of the sanitizing changes, it can easily be seen that the results are all harmless.
2024-03-20 10:57:16 -07:00
oleibman 891180e13d Protect Sheet But Allow Sort
Fix #3951. When an Excel sheet is protected, even when sorting is explicitly allowed without a password, sorts are permitted only on "protected ranges" within the sheet. PhpSpreadsheet already supports protected ranges, and only minor tinkering is necessary for that (e.g. the protected range can have, but does not require, a password). The more important part of this change is documenting the far-from-intuitive way that Excel handles this. To that end, documentation is updated, and a new sample is added.

A new class, `Worksheet\ProtectedRange` is added in place of the string array which had been used. `Worksheet::getProtectedCells` is deprecated in favor of the new `Worksheet::getProtectedCellRanges`.
2024-03-20 07:04:24 -07:00
oleibman a6ef9a7b28 Merge pull request #3945 from oleibman/hidecol
Hidden Rows and Columns - Tcpdf and Mpdf
2024-03-19 21:09:54 +00:00
oleibman 8a1d424056 Merge pull request #3942 from oleibman/issue3935
Invalid Builtin Defined Name in Xls Reader
2024-03-19 21:05:40 +00:00
oleibman 2a8345dde9 Merge pull request #3940 from oleibman/issue3923
Unallocated Cells Affected by Column/Row Insert/Delete
2024-03-15 22:53:40 +00:00
oleibman fbcd68ce87 Update CHANGELOG.md 2024-03-15 15:49:29 -07:00
oleibman 44e8b4886c Merge branch 'master' into issue3923 2024-03-15 14:07:25 -07:00
oleibman 9b3f205528 Merge pull request #3939 from oleibman/sysformats2
Additional Support for Date/Time Styles
2024-03-15 18:49:01 +00:00
Ramseyer Claude d0e8c03226 Fix default value for Conditional::$text 2024-03-12 17:20:08 +01:00
oleibman 26882fed90 Allow Scrutinizer C
I am tired of complexity warnings for non-complex code.
2024-03-11 19:34:57 -07:00
oleibman 47012ba228 Hidden Rows and Columns - Tcpdf and Mpdf
Tcpdf issues warnings when processing hidden rows. Some time ago, Mpdf was having problems in the same situation; this was resolved by not writing out hidden rows in the html which Mpdf uses to generate its file. The same solution can be easily applied to Tcpdf.

Neither Tcpdf nor Mpdf handles hidden columns. Dompdf doesn't have a problem with either rows or columns. At any rate, the solution for Tcpdf/Mpdf is to not write out the data in the hidden columns. It is more difficult to implement this for columns than for rows, but this PR should do the trick.

Html writer generally uses `display:none` for the data in suppressed columns. This works, but is technically incorrect - the "approved" method is `visibility:collapse` on the col element. However, Firefox doesn't handle that correctly (open bug was filed over a decade ago), and, since all browsers seem to handle the existing implementation, it is left alone.

Among other considerations, this PR is a necessary precursor for supporting printArea in Html/Pdf should we decide to do that (issue #3941).

Writer/Html protected property `$isMPdf` is deprecated with this PR in favor of testing for `instanceof Mpdf`.
2024-03-11 18:54:48 -07:00
Mark Baker d01575416a Merge pull request #3937 from PHPOffice/Looping_the_Loop
Documentation about Iterating through Cells
2024-03-11 15:24:53 +00:00
Mark Baker a1e1af697c Merge pull request #3936 from PHPOffice/Behind_the_Mask
Documentation about Number Format Masking
2024-03-11 15:17:14 +00:00
Mark Baker 7b55c61552 Merge pull request #3938 from PHPOffice/The_Dating_Game
Documentation about Date Handling
2024-03-11 15:13:54 +00:00
oleibman 5fb1fb48b5 Invalid Builtin Defined Name in Xls Reader
Fix #3935. Xls Reader cannot parse user's spreadsheet, failing on a token of 3d. I believe that, according to https://msopenspecs.azureedge.net/files/MS-XLS/%5bMS-XLS%5d.pdf, this represents a PtgAreaErr3d, i.e. an invalid reference. User cannot provide spreadsheet, but was quite forthcoming in providing additional debugging information. I am usually reluctant to make changes without a test case, however, in this case, the action being taken (treat "builtin" defined name as "not builtin" when it cannot be parsed) makes sense, and it satisfies the user's processing.
2024-03-09 12:56:21 -08:00
oleibman 7893942a72 Unallocated Cells Affected by Column/Row Insert/Delete
Fix #3923. Cells which have not yet been allocated cause problems when they need to be moved due to a column/row insert/delete. Code had been added in ReferenceHelper earlier to create missing cells, but only in the last data column. It needs to change to create the missing cells:
- for columns, in rows 1 to "highest data row" for columns "before column" to "highest data column".
- for rows, in columns A to "highest data column" for rows "before row" to "highest data row".
2024-03-09 11:05:50 -08:00
oleibman accb321197 Additional Support for Date/Time Styles
Excel supports the following notations for cell styles:
- `[$-F800]` and `[$-x-sysdate]` will format the date according to what appears to be the user's system long date format.
- `[$-F400]` and `[$-x-systime]`, will format the time according to what appears to be the user's system long time format.
- Builtin style 14 will format date according to what appears to be the user's system short date format.
- Builtin style 22 will format date and time according to the user's preference. It appears that the date portion is formatted according to the user's system short date format, but the time portion is formatted according to a format which is neither system short time format nor system long time format, so I'm not sure how this preference is set.

For F800, sysdate, F400, and systime, any other characters in the style are ignored, except that, if you have more than one of this type of block in the style, Excel will treat it as corrupt (error message on open and style changed to General).

Support is added for the new codes. In addition, note that the value displayed in the cell may differ in different environments. To give the PhpSpreadsheet programmer an opportunity to emulate what the intended audience will most often see, properties `shortDateFormat` (default value is builtin 14), `longDateFormat` (default value is `dddd, mmmm d, yyyy`), `dateTimeFormat` (defaults to builtin 22), and `timeFormat` (default is `FORMAT_DATE_TIME2`), with corresponding setters and getters, are added to Style/NumberFormat. Note that, if these properties are set to some other value in PhpSpreadsheet, it will not affect the values in the cell or the style - it is merely a convenience for the programmer. It will, however, affect column width if autosize is specified for the column. If the programmer does not alter any of the new properties, the output should be unchanged from before for builtins 14 and 22.

The new styles are also recognized by the `TEXT` function. In this case, the cell's calculated value may differ from user to user.

Note that this is a small subset of adding locale information to styles. No attempt is made to support any of the other possibilities - locale data will continue to be passed through to the spreadsheet, but PhpSpreadsheet will discard it before attempting to generate the formatted value of a cell.
2024-03-08 21:13:56 -08:00
oleibman 9a94aea7ad Merge pull request #3924 from oleibman/issue3918
Default Style Alignment
2024-03-09 04:23:01 +00:00
oleibman 280c18e8ee Update CHANGELOG.md 2024-03-08 20:17:13 -08:00