Malformed URIs are not rewritten
- Dominant language
- C#
- Stars
- 4.6k
- Forks
- 605
- PR merge metrics
- No merged PRs in 30d
Description
**Steps to reproduce**
- Create a Microsoft Excel workbook (from Excel UI) in which you insert a hyperlink with an invalid URI, such as `file://https:\gna\gna\gna` (Excel allows to insert hyperlinks with invalid URIs).
- Open that workbook with the Open XML SDK.
**Observed behavior**
Malformed URI exception because the URI is invalid and not rewritten.
Indeed, Open XML only rewrites the URI if `Uri.TryCreate("mailto:one@")` returns `false`, but on my computer it returns `true`, so other invalid URIs are not rewritten.
**Expected behavior**
Open XML should not throw any exception, and the invalid URIs should be rewritten into rewritten://{GUID}
**Desktop:**
- OS: Windows
- Office version: version 2508, build 16.0.19127.20192 64 bits
- .NET Target: .NET Framework 4.8
- DocumentFormat.OpenXml Version: 3.3.0
This is really blocking for us and we'd like to keep using Open XML :)
Thanks,
Larry
Contributor guide
Assessment
This issue has not been assessed yet.