Bug 95914 - [1] Hyperlink erroneously urlencodes hash chars (Calc/Impress/Writer)
Summary: [1] Hyperlink erroneously urlencodes hash chars (Calc/Impress/Writer)
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: framework (show other bugs)
Version:
(earliest affected)
3.5.0 release
Hardware: x86-64 (AMD64) All
: medium trivial
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Hyperlink
  Show dependency treegraph
 
Reported: 2015-11-18 18:36 UTC by Gert
Modified: 2019-08-08 09:04 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gert 2015-11-18 18:36:33 UTC
OS: Debian Jessie amd64
LibreOffice version: 5.0.2 (english) installed from jessie-backports
Steps to reproduce:

(for shorter writing, I use abbreviations:
$RIGHTURL="https://www.freevoipdeal.com/calling_rates/#/#letter-N"
$WRONGURL="https://www.freevoipdeal.com/calling_rates/#/%23letter-N"
)

Calc:
1. open Calc
2. enter in A1: =HYPERLINK("$RIGHTURL";"$RIGHTURL")
3. go back to A1 and see it indeed has the correct formula, and that the output of the cell is $RIGHTURL
4. additionally, hover with mouse over hyperlink, the tooltip says $RIGHTURL.
5. ctrl+click the hyperlink
6. Firefox (well, Iceweasel in my case) opens, the address bar says $WRONGURL
7. see that Firefox doesn't scroll to the "letter-N" section of the page

Impress:
1. open Impress
2. select: Insert -> Hyperlink, type in Target field: $RIGHTURL, choose OK
3. see the hyperlink title is $WRONGURL
4-7. same as Calc 4-7.

Writer:
1. open Writer
2-3. same as Impress step 2-3.
4. additionally, hover with mouse over hyperlink, the tooltip says $WRONGURL.
5. right-click on the hyperlink, choose "Edit Hyperlink"
6. see both Title and Text fields say $WRONGURL
7-9. same as Calc/Impress 5-7.

Note the differences in step 4 (tooltip), only Writer says $WRONGURL.
Also, in Writer/Impress at step 2, when I aditionally put $RIGHTURL in the Text field (instead of leaving blank), the hyperlink title is $RIGHTURL.

When instead as URL I try http://localhost/### , FF goes to http://localhost/#%23%23
So it seems only the first # survives unscathed (I guess because there's already some code to protect such HTML-section-URLs).
Starting Firefox with these URLs as command line argument works fine (scrolls to section).

I never needed this functionality, so I don't know in which version this bug appeared.

Regardless, thanks!
Gert
Comment 1 Buovjaga 2015-11-19 06:58:44 UTC
Repro.

Win 7 Pro 64-bit Version: 5.1.0.0.alpha1+
Build ID: b216cc1b8096eb60c27f67e8c27b7cd756c75e38
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2015-11-12_00:06:20
Locale: fi-FI (fi_FI)

3.5.0
Comment 2 QA Administrators 2017-01-03 19:35:15 UTC Comment hidden (obsolete)
Comment 3 Gert 2017-01-03 20:24:31 UTC
bug still present in 5.2.3.3

OS: Debian Jessie 8.6 amd64
Libreoffice version: 1:5.2.3-2~bpo8+1 (dutch) installed from jessie-backports

Version: 5.2.3.3
Build ID: 1:5.2.3-2~bpo8+1
CPU Threads: 2; OS Version: Linux 4.7; UI Render: default; VCL: gtk3; 
Locale: nl-NL (nl_NL.UTF-8); Calc: group
Comment 4 QA Administrators 2018-08-22 02:36:57 UTC Comment hidden (obsolete)
Comment 5 Mike Kaganski 2019-08-08 08:24:56 UTC
I am unsure this is a bug. Why would that be a valid URL? Hashes (or "Number signs" #) have special meaning in URLs - they are reserved; namely, they mark a fragment part of the URL - and there may be only one such unencoded mark; all other hashes must be url-encoded (see RFC 3986 [1] sections 1.2.3, 2.2, etc.). So the "$RIGHTURL" from comment 0 is actually "$INVALIDURL"; and my proposal would be close it NOTABUG.

[1] https://tools.ietf.org/html/rfc3986
Comment 6 Stephan Bergmann 2019-08-08 09:04:29 UTC
Yes, the first "#" sets off the fragment part.  And any further "#" are apparently escaped by LO when it passes on the URL (which is legal for LO to do, even though it may not be helpful for certain consumers that would interpret the non-escaped URL in a nonstandard way).