1400 Commits

Author SHA1 Message Date
oleibman 299993894d Security Patch 2026-09-15 20:50:30 -07:00
oleibman cbe82dad83 Restore Test, Account for Github Unexpected Error 2026-07-12 05:32:04 -07:00
oleibman 32fdf9e694 Security Patches 2026-07-12 00:56:28 -07:00
oleibman ed3b50e158 Security Patch Try 2 2026-05-30 23:54:12 -07:00
oleibman 44b8dac2b6 Revert "Security Patch"
This reverts commit 49d828bbd2.
2026-05-30 23:09:07 -07:00
oleibman 49d828bbd2 Security Patch 2026-05-30 22:27:49 -07:00
oleibman c91ff54b74 Security Patches 2026-04-18 22:39:40 -07:00
oleibman 59a837f2eb Option to Whitelist External Images (#4851) 2026-04-04 23:03:40 -07:00
oleibman 4331d3af1b Security Patches 2026-04-04 22:05:58 -07:00
oleibman dfa2b1db80 Changes to WEBSERVICE R210 (#4757) 2025-12-22 22:16:28 -08:00
oleibman 1fdee23756 Update Mpdf (Php8.5 compatibility) r210 (#4593) 2025-08-21 13:42:56 -07:00
oleibman 81a0de2261 Breaking Change When Loading External Images
Images will be loaded from an external source (e.g. http://example.com/img.png) only if the reader is explicitly set to allow it via `$reader->setAllowExternalImages(true)`.
2025-08-02 18:33:29 -07:00
oleibman cfcbeaf4e4 All Readers - Allow or Forbid Fetching of External Images Release210 (#4546)
* All Readers - Allow or Forbid Fetching of External Images Release210

Add to all readers the option to allow or forbid fetching external images. This is unconditionally allowed now. The default will be set to "allow", so no code changes are necessary. However, we are giving consideration to changing the default.

* Update Changelog
2025-07-22 21:42:08 -07:00
oleibman 2219dedada Removing Columns/Rows Containing Merged Cells (#4472)
Backport PR #4465.
2025-05-15 22:02:25 -07:00
oleibman 126309f5e9 Allow Spreadsheet Serialization Branch release210 (#4406) 2025-03-14 07:37:33 -07:00
oleibman 99f5c18e51 Allow php-cs-fixer to Handle Implicit Backslashes 2025-02-10 22:20:43 -08:00
oleibman 12c2e79288 Fix TEXT and TIMEVALUE Functions 2.1 Branch (#4353)
Fix #4249. Technically speaking, only the 1.29 branch needs fixing, and only for TEXT. It was fixed for the other branches by PR #3898. However, in adding test cases for the fix, it became apparent that PhpSpreadsheet's parsing in TIMEVALUE (which is called from TEXT in the original issue) did not really match Excel's. There are probably still edge cases where it doesn't, but, in the absence of a spec for how it operates, this will do for now.

We do not usually backport fixes from the master branch. Because this is more of a forward port from the earlier branch, there is an equivalent PR for each active branch.
2025-02-10 20:46:55 -08:00
oleibman 3789837ca7 Backport 2 Fixes to Writer/Xls/Parser
PR #4333 and PR #4344.
2025-02-06 20:05:26 -08:00
oleibman f68f688810 Security Patch Special Characters in Protocol 2025-01-23 22:40:52 -08:00
oleibman 173ff7b936 Tweak One Test
Fluke failure in CI push.
2025-01-15 01:50:39 -08:00
oleibman 6e5bbcd045 Backported Security Patch 2025-01-11 19:19:56 -08:00
oleibman 3ebcbcf2cd Change hash code for worksheet branch release210 (#4307)
* Change hash code for worksheet branch release210

Backport of PR #4207

* Retitling Clone Worksheets

Backport of PR #4302.
2025-01-08 14:37:50 -08:00
oleibman 04e8b6edc1 Backport Html Writer Security Patches 2024-12-26 21:13:22 -08:00
oleibman 3df80f9a46 Restore Accidentally Disabled Test 2024-12-15 14:48:25 -08:00
oleibman 7327aa0d45 Upgrade Dompdf, Tcpdf, .gitattributes 2024-12-07 22:01:17 -08:00
oleibman 2dac558f34 Fix Minor Break Handling Drawings
Backport of #4241. Some security batches caused a minor break in Drawings, forcing `setWorksheet` to come after `setPath`. Although the problem is easily fixed in user code, this was not an intended change. Some slight recoding restores the earlier functionality where the order of calls was not important, without sacrificing the security gains.
2024-11-25 20:19:54 -08:00
oleibman 52de298ece Ignore Settings::libXmlLoaderOptions
Backport of PR #4233.
2024-11-21 22:17:24 -08:00
oleibman 819854a668 Upgrade PhpUnit
To a version which is aware that Php8.4 deprecates E_STRICT.
2024-11-14 12:08:33 -08:00
oleibman db89fe2b2b Simplify Test Bootstrap 2024-11-13 08:43:07 -08:00
oleibman 4545ecf648 Downgrade Symfony/Process
A bit messier than expected. Current version of symfony/process (used only in dev) has a security advisory. There is no version that can be upgraded to which supports Php8.0. However, a downgrade to V5 will work.

When running with Php8.4, PhpUnit references E_STRICT, which is deprecated in 8.4. I don't understand why this doesn't happen with release1291. Be that as it may, we can't upgrade Phpunit to V10 because we need to support Php8.0. So, monkey around with tests/bootstrap.php to avoid problems.
2024-11-12 19:23:20 -08:00
oleibman fbd9a63e2f Backport Security Patch 2024-11-10 01:29:56 -08:00
oleibman 2a1ece2ec0 Backport PR #4189 Csv Method 2024-10-14 21:53:35 -07:00
oleibman 60b115c312 Forgot to Delete Some Lines 2024-09-24 17:55:03 -07:00
oleibman c26e766130 Restore 2 Disabled Tests 2024-09-24 17:47:28 -07:00
oleibman e04ed222b3 Backport Security Patch 2024-09-24 05:55:56 -07:00
oleibman 392dd08c55 Html Writer Validate Hyperlink Protocols 2024-09-14 05:26:18 -07:00
oleibman a2448b197a More Tests 2024-09-13 10:18:23 -07:00
oleibman bc74f3aa1d Validate POST Data in Sample 45
Errors can result if not validated.
2024-09-08 15:40:25 -07:00
oleibman 949ff63e1f Prepare Csv Reader for Php8.4
Also security patches.
2024-09-08 11:53:27 -07:00
oleibman 4577f615c4 Merge branch 'master' into issue3995 2024-05-09 22:49:11 -07:00
oleibman d38b7cb35f Merge pull request #4016 from oleibman/stan9a
Better Definitions for Mixed Parameters and Values Part 1 of Many
2024-05-09 06:28:54 +00:00
oleibman b2befb4426 Correct Wrong-Case Directory Name 2024-05-06 16:50:02 -07:00
oleibman 09c9a310a0 Html Reader Non-UTF8 Charsets
Fix #3995. Fix #866. Fix #1681. Php DOM loadhtml defaults to character set ISO-8859-1, but our data is UTF-8. So Html Reader alters its html so that loadhtml will not misinterpret characters outside the ASCII range. This works for UTF-8, but breaks other charsets. However, loadhtml uses the correct non-default charset when charset is specified in a meta tag, or when the html starts with a BOM. So, it is sufficient for us to alter the non-ASCII characters only when (a) the data does not start with a BOM, and (b) there is no charset tag.

This will allow us to use:
- UTF-8 files or snippets without BOM, with or without charset
- UTF-8 files with BOM (charset should not be specified and will be ignored if it is)
- UTF-16 files with BOM (charset should not be specified and will be ignored if it is)
- all charsets which are ASCII-compatible for 0x00-0x7f when the charset is declared. This applies to ASCII itself, many Windows and Mac charsets, all of ISO-8859, and most CJK and other-language-specific charsets.

We cannot use:
- UTF-16BE or UTF-16LE declared in a meta tag
- UTF-32, with or without a BOM (browser recommendation is to not support UTF-32, and most browsers do not support it)
- unknown (to loadhtml) or non-ASCII-compatible charsets (EBCDIC?)

I will note that the way I detect the `charset` attribute is imperfect (e.g. might find it in text rather than a meta tag). I think we'd need to write a browser to get it perfect. Anyhow, it is about the same as XmlScanner's attempt to find the `encoding` attribute, and, if it's good enough there, it ought to be good enough here.
2024-05-06 16:43:23 -07:00
oleibman 8d5577a3c4 Improved Test for ConvertUOM
Scrutinizer balked at quotes around key 'Unit Name'; no reason not to use 'UnitName' instead.

Having done that, several ConvertUOM tests seemed a little unconvincing. Replaced them with improved versions.
2024-05-05 06:14:28 -07:00
oleibman 64f354eb6e Better Definitions for Mixed Parameters and Values Part 1 of Many
Improve documentation within program by making explicit what types of values are allowed for variables described as "mixed". In order to avoid broken functionality, this is done mainly through doc-blocks. This will get us closer to Phpstan Level 9, but many changes will be needed before we can consider that.

Executable code change is to add 2 new methods to Cell - `getValueString` and `getCalculatedValueString`, which are the same as the methods without the String suffix, except that they always return a string result. These are invoked at several places in the code where it makes sense, in particular by Writer code.
2024-05-05 04:37:46 -07:00
oleibman c56a58358e Merge pull request #4006 from oleibman/issue4004
RTL Text Alignment in Xlsx Comment
2024-05-05 11:17:55 +00:00
oleibman db602bde89 Merge branch 'master' into issue4001 2024-05-04 21:05:15 -07:00
oleibman 8485cd195f Merge pull request #4003 from oleibman/issue3999
Improvements to Xml Reader
2024-05-05 03:55:44 +00:00
oleibman d40a1cfa52 Xml Reader Rich Text
Fix #4001. Thanks to @SlowFox71 who reported the problem and developed most of the solution. This PR adds Rich Text support to the XML reader. The Xml Spreadsheet stores Rich Text as Html tags, children of the ss:Data tag using a specific namespace. These can be parsed into a RichText object using existing method Helper/Html::toRichTextObject. There are 2 items which need special attention.

First, for attributes like bold or italic, Excel uses the appropriate Html tag (e.g. `<B>`). However, for an attribute like color, Excel uses `<Font html:Color="#FF0000">`, with a prefix on the Color tag. PhpSpreadsheet's Html parser cannot cope with the prefix. The parser is changed to strip `html:` from attribute names for the Font tag.

The example cited by the user used a `<BR />` to indicate a line break in the data. However, it appears that, at least some of the time, Excel will instead use `&#10;` to indicate a line break. The existing parser reduces one or more whitespace characters in the text to a single space, and so `&#10;` will wind up disappearing. I am not sure why the existing code does this, but I do know that I am not willing to break it. Instead, I've added an optional boolean parameter `$preserveWhiteSpace` to `toRichTextObject`. If false (default), the existing logic will be used; but if true, substitution for whitespace characters in the text will not happen.
2024-04-30 23:51:13 -07:00
oleibman 455f1129bf RTL Text Alignment in Xlsx Comment
Fix #4004. RTL text can be included in a comment, and will display correctly, but the comment as a whole will be left-aligned. There already exists an `alignment` property for Comment, but it is unused. This PR will allow that property to be set, and to be read from and written to an Xlsx spreadsheet when possible.

The Xml tags that govern this property are found, unusually, in a drawing Vml file. The important property is `x:TextHAlign`, which can be set to Left, Right, Center, Justified, or Distributed. There are other tags which seemed like they were relevant to this problem, but I don't think they actually matter:
```xml
  <v:textbox style='mso-direction-alt:auto'>
   <div style='text-align:right;direction:rtl'></div>
  </v:textbox>
```
2024-04-30 22:22:03 -07:00