Skip to content

Commit a844916

Browse files
committed
Merge develop8
2 parents 5accffe + ede8683 commit a844916

26 files changed

Lines changed: 520 additions & 91 deletions

File tree

SECURITY.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# Security Policy
22

3-
_Last updated: 2025-06-10_
3+
_Last updated: 2026-01-08_
44

55
## Supported Versions
66

7-
EPPlus 6, 7 and 8 are automatically scanned for vulnerabilities and static code analysis is performed as part of the CI.
7+
EPPlus 7 and 8 are automatically scanned for vulnerabilities and static code analysis is performed as part of the CI.
88

99
| Version | Supported | Comment | Deprecation date |
1010
| ------- | ------------------ | ------------------ |----|
1111
| 8.x.x | :white_check_mark: | ||
1212
| 7.x.x | :white_check_mark: | ||
13-
| 6.x.x | :white_check_mark: | |2025-12-31|
13+
| 6.x.x | :x: |Deprecated/unsupported versions |2025-12-31|
1414
| 5.x.x | :x: |Deprecated/unsupported versions |2024-12-31|
15-
| < 4.3 | :x: |Deprecated/unsupported versions|2020-12-31|
15+
| < 4.5 | :x: |Deprecated/unsupported versions|2020-12-31|
1616

1717
## Security update policy
1818
Security patches will be provided via new revisions released in our public Nuget feed. One patch for each supported major version/the two latest minor versions will be provided. [Subscribe to our newsletter](https://epplussoftware.com/en/Home/Newsletter) to get updates from EPPlus Software.

appveyor8.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 8.4.0.{build}
1+
version: 8.4.1.{build}
22
branches:
33
only:
44
- develop8
@@ -10,15 +10,15 @@ install:
1010
& $env:temp\dotnet-install.ps1 -Architecture x64 -Version '10.0.100' -InstallDir "$env:ProgramFiles\dotnet"
1111
init:
1212
- ps: >-
13-
Update-AppveyorBuild -Version "8.4.0.$env:appveyor_build_number-$(Get-Date -format yyyyMMdd)-$env:appveyor_repo_branch"
13+
Update-AppveyorBuild -Version "8.4.1.$env:appveyor_build_number-$(Get-Date -format yyyyMMdd)-$env:appveyor_repo_branch"
1414
15-
Write-Host "8.4.0.$env:appveyor_build_number-$(Get-Date -format yyyyMMdd)-$env:appveyor_repo_branch"
15+
Write-Host "8.4.1.$env:appveyor_build_number-$(Get-Date -format yyyyMMdd)-$env:appveyor_repo_branch"
1616
dotnet_csproj:
1717
patch: true
1818
file: '**\*.csproj'
1919
version: '{version}'
20-
assembly_version: 8.4.0.{build}
21-
file_version: 8.4.0.{build}
20+
assembly_version: 8.4.1.{build}
21+
file_version: 8.4.1.{build}
2222
nuget:
2323
project_feed: true
2424
before_build:

docs/articles/fixedissues.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
# Features / Fixed issues - EPPlus 8
2+
## Version 8.4.1
3+
* Fixes several issues related to expanding (spilling) and contracting dynamic array formulas.
4+
* Changing cell dependencies were not taken into account when recalculating dirty cells from dynamic array formulas.
5+
* Clearing dynamic array formulas that reduced in size did not work correctly.
6+
* Cells containing formulas with the INDIRECT function are now always treated as dynamic.
7+
* Invalid UTF-16 surrogate sequences in comment text are now sanitized before XML generation to prevent ´XmlException´.
8+
* Using the [@page] attribute in headers or footers did not return the next character in some cases.
9+
* The FILTER function always returned the third parameter if it contained an error value (for example, #VALUE!).
10+
* The FACT function returned (n-1)! instead of n!.
11+
* Formula inline arrays did not correctly convert scientific notation (for example, 1.0E-305) to numbers.
12+
* Defined names could use the wrong scope when a name existed in both worksheet and workbook scope and a formula was calculated using the ´Calculate(formula)´ method.
13+
* Using the ^ operator on non-numeric values returned 0 instead of #VALUE!.
14+
* Inserting columns into an empty worksheet throw an ´ArgumentExceptio´n when inserting more than 8 columns.
15+
* GROWTH and TREND did not handle a single-value newX parameter correctly.
16+
217
## Version 8.4.0
318
### Features
419
* Added targeting framework .NET 10.

src/EPPlus/ConditionalFormatting/ExcelConditionalFormattingHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public static double GetAttributeDouble(
202202
try
203203
{
204204
var value = node.Attributes[attribute].Value;
205-
return double.Parse(value, NumberStyles.Number, CultureInfo.InvariantCulture);
205+
return double.Parse(value, NumberStyles.Number | NumberStyles.AllowExponent, CultureInfo.InvariantCulture);
206206
}
207207
catch
208208
{

src/EPPlus/EPPlus.csproj

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>net8.0;net9.0;net10.0;netstandard2.1;netstandard2.0;net462;net35</TargetFrameworks>
4-
<AssemblyVersion>8.4.0.0</AssemblyVersion>
5-
<FileVersion>8.4.0.0</FileVersion>
6-
<Version>8.4.0</Version>
4+
<AssemblyVersion>8.4.1.0</AssemblyVersion>
5+
<FileVersion>8.4.1.0</FileVersion>
6+
<Version>8.4.1</Version>
77
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
88
<PackageProjectUrl>https://epplussoftware.com</PackageProjectUrl>
99
<Authors>EPPlus Software AB</Authors>
@@ -18,17 +18,20 @@
1818
<PackageReadmeFile>readme.md</PackageReadmeFile>
1919
<Copyright>EPPlus Software AB</Copyright>
2020
<PackageReleaseNotes>
21-
EPPlus 8.4.0
21+
EPPlus 8.4.1
2222

2323
IMPORTANT NOTICE!
2424
From version 5 EPPlus changes the license model using a dual license, Polyform Non Commercial / Commercial license.
2525
EPPlus will still have the source available, but for non Polyform NC compliant projects, EPPlus will provide a commercial license.
2626
Commercial licenses can be purchased from https://epplussoftware.com
2727
This applies to EPPlus version 5 and later. Earlier versions are still licensed LGPL.
2828

29+
## Version 8.4.1
30+
* Minor bug fixes. See https://epplussoftware.com/Developers/MinorFeaturesAndIssues
31+
2932
## Version 8.4.0
3033
* Added target framework .NET 10.
31-
Minor bug fixes. See https://epplussoftware.com/Developers/MinorFeaturesAndIssues
34+
Minor bug fixes.
3235

3336
## Version 8.3.1
3437
Minor bug fixes.
@@ -545,6 +548,7 @@
545548
A list of fixed issues can be found here https://epplussoftware.com/docs/7.0/articles/fixedissues.html
546549

547550
Version history
551+
8.4.1 20260112 Minor bug fixes.
548552
8.4.0 20251212 Updated target frameworks. Minor bug fixes.
549553
8.3.1 20251128 Minor bug fixes.
550554
8.3.0 20251120 Connections and query tables support. Minor features and bug fixes. See https://epplussoftware.com/Developers/MinorFeaturesAndIssues

src/EPPlus/ExcelWorksheet.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Date Author Change
5050
using System.Linq;
5151
using System.Text;
5252
using System.Xml;
53+
using System.Security.Permissions;
5354

5455
namespace OfficeOpenXml
5556
{
@@ -77,8 +78,8 @@ internal struct MetaDataReference
7778
{
7879
internal uint cm;
7980
internal uint vm;
80-
internal bool aca;
81-
internal bool ca;
81+
//internal bool aca; //Removed, is set as a flag instead in the _flags store.
82+
//internal bool ca; //Removed, is set as a flag instead in the _flags store.
8283
}
8384
/// <summary>
8485
/// Removes all formulas within the entire worksheet, but keeps the calculated values.
@@ -2633,6 +2634,10 @@ private void UpdateCommentRichText()
26332634
{
26342635
foreach (ExcelComment comment in _comments)
26352636
{
2637+
foreach(var rt in comment.RichText)
2638+
{
2639+
rt.Text = StringUtil.SanitizeUtf16(rt.Text);
2640+
}
26362641
var textNode = comment._commentHelper.GetNode("d:text");
26372642
textNode.InnerXml = comment.RichText.GetXML();
26382643
}

src/EPPlus/FormulaParsing/CalculateExtensions.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,34 @@ public static void Calculate(this ExcelWorkbook workbook, ExcelCalculationOption
8181
workbook.FormulaParser.Logger.Log(msg);
8282
}
8383
}
84+
internal static RpnOptimizedDependencyChain CalculateWithDC(this ExcelWorkbook workbook, Action<ExcelCalculationOption> configHandler)
85+
{
86+
var option = new ExcelCalculationOption();
87+
configHandler.Invoke(option);
88+
return CalculateWithDC(workbook, option);
89+
}
90+
internal static RpnOptimizedDependencyChain CalculateWithDC(this ExcelWorkbook workbook, ExcelCalculationOption options)
91+
{
92+
Init(workbook);
93+
94+
var filterInfo = new FilterInfo(workbook);
95+
workbook.FormulaParser.InitNewCalc(filterInfo);
96+
97+
if (workbook.FormulaParser.Logger != null)
98+
{
99+
var msg = string.Format("Starting formula calculation.");
100+
workbook.FormulaParser.Logger.Log(msg);
101+
}
102+
103+
//CalcChain(workbook, workbook.FormulaParser, dc, options);
104+
var dc = RpnFormulaExecution.Execute(workbook, options);
105+
if (workbook.FormulaParser.Logger != null)
106+
{
107+
var msg = string.Format("Calculation done...number of cells parsed: {0}", dc.processedCells.Count);
108+
workbook.FormulaParser.Logger.Log(msg);
109+
}
110+
return dc;
111+
}
84112
/// <summary>
85113
/// Calculate all formulas in the current worksheet
86114
/// </summary>

src/EPPlus/FormulaParsing/DependencyChain/ArrayFormulaOutput.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ internal static SimpleAddress[] FillDynamicArrayFromRangeInfo(RpnFormula f, IRan
151151
CleanupSharedFormulaValues(f, ws, sf, endRow, endCol);
152152
sf.EndRow = endRow;
153153
sf.EndCol = endCol;
154+
154155
}
155156
FillArrayFromRangeInfo(f, array, rd, depChain);
156157
return dirtyRange;
@@ -239,8 +240,10 @@ private static SimpleAddress[] GetDirtyRange(int fromRow, int fromCol, int toRow
239240

240241
private static void ClearDynamicFormulaIndex(ExcelWorksheet ws, int fromRow, int fromCol, int toRow, int toCol)
241242
{
242-
ws._formulas.Clear(fromRow, fromCol, toRow, toCol);
243-
ws._flags.Clear(fromRow, fromCol, toRow, toCol);
243+
var rows = toRow - fromRow + 1;
244+
var cols = toCol - fromCol + 1;
245+
ws._formulas.Clear(fromRow, fromCol, rows, cols);
246+
ws._flags.Clear(fromRow, fromCol, rows, cols);
244247

245248
for (int col = fromCol; col <= toCol; col++)
246249
{

src/EPPlus/FormulaParsing/DependencyChain/RpnFormula.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,28 @@ public override string ToString()
261261
}
262262
}
263263

264-
internal void ClearCache()
264+
internal void ClearCache(RpnOptimizedDependencyChain depChain)
265265
{
266266
foreach (var e in _expressions.Values)
267267
{
268268
if (e.ExpressionType == ExpressionType.CellAddress)
269+
{
269270
e._cachedCompileResult = null;
271+
}
272+
if(e.ExpressionType == ExpressionType.Function)
273+
{
274+
var funcExp= e as FunctionExpression;
275+
funcExp.Status = ExpressionStatus.NoSet;
276+
var key = funcExp.GetExpressionKey(this);
277+
if (key != null)
278+
{
279+
var cache = depChain.GetCache(_ws);
280+
if (cache.ContainsKey(key))
281+
{
282+
cache.Remove(key);
283+
}
284+
}
285+
}
270286
}
271287
}
272288

0 commit comments

Comments
 (0)