Bug 168181 - RTF import: Hyperlink pointing to a system path with backslashes imports with double backslashes
Summary: RTF import: Hyperlink pointing to a system path with backslashes imports with...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:26.2.0 target:25.8.2
Keywords: filter:rtf
Depends on:
Blocks:
 
Reported: 2025-08-29 18:48 UTC by Mike Kaganski
Modified: 2025-09-18 08:52 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
A sample RTF with hyperlink with backslashes (98 bytes, application/msword)
2025-08-29 18:48 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2025-08-29 18:48:21 UTC
Created attachment 202601 [details]
A sample RTF with hyperlink with backslashes

The RTF is simplified from what Word 2016 generated. The system path in it is c:\temp\doc1.doc. According to RTF spec 1.9.1 (which points to OOXML), the backslashes in field text must be escaped with a second backslash. That gives field text of c:\\temp\\doc1.doc. Then to save this to RTF, which itself uses backslash as a special character (starting keywords), every backslash must be escaped with another backslash. This produces c:\\\\temp\\\\doc1.doc; and indeed, Word created exactly that string in the RTF. It must be reversed to original c:\temp\doc1.doc on import; but Writer imports c:\\temp\\doc1.doc.

Ref: https://ask.libreoffice.org/t/125994/
Comment 1 Commit Notification 2025-08-29 21:45:53 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/0863f0c4ed983b05c2d86cb42283518e38a77320

tdf#168181: process field backslash escaping properly

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 2 Commit Notification 2025-09-01 11:20:38 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

https://git.libreoffice.org/core/commit/13eee625a31b5aa0c4bd7d52a7df9e897a093ba0

tdf#168181: process field backslash escaping properly

It will be available in 25.8.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.