Bug 109104 - ENCODEURL() function does not correctly encode newlines
Summary: ENCODEURL() function does not correctly encode newlines
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.0 all versions
Hardware: All All
: medium normal
Assignee: Julien Nabet
QA Contact:
URL:
Whiteboard: target:6.0.0 target:5.3.6 target:5.4.2
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-13 15:10 UTC by bele
Modified: 2017-08-19 10:59 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Table with the URLENCODE function (9.41 KB, application/vnd.oasis.opendocument.spreadsheet)
2017-07-13 15:11 UTC, bele
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bele 2017-07-13 15:10:33 UTC
if the string put through the URLENCODE function contains a newline, it will convert it to "%A" not to "%0A". this results in an invalid char dependeding on what letter comes next!
Comment 1 bele 2017-07-13 15:11:52 UTC
Created attachment 134618 [details]
Table with the URLENCODE function
Comment 2 Xisco Faulí 2017-07-14 08:58:51 UTC
Thank you for reporting the bug.
it seems you're using an old version of LibreOffice.
Could you please try to reproduce it with the latest version of LibreOffice from https://www.libreoffice.org/download/libreoffice-fresh/ ?
I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the bug is still present in the latest version.
Comment 3 bele 2017-07-15 18:41:42 UTC
I allready use 5.3, but it says earliest affected version. I appears since 5.0 earlier I didn't use the function.
For you i just reinstalled version 5.3.4.2 and it appears also. It is easy to test with the attached Document above: http://bugs.documentfoundation.org/attachment.cgi?id=134618
Comment 4 Julien Nabet 2017-07-24 17:32:26 UTC
On pc Debian x86-64 with master sources updated today, I indeed got %A
Comment 5 bele 2017-08-09 10:25:39 UTC
wrongly translated the name of the calc Function to URLENCODE. Its name is ENCODEURL in the english version!
Comment 6 bele 2017-08-09 12:34:19 UTC
the error occurs in ScInterpreter::ScEncodeURL
file: core/sc/source/core/tool/interpr7.cxx line 328
but i dont know how to fix it. The leading zero gets somehow lost.
Comment 7 Julien Nabet 2017-08-12 10:45:28 UTC
I submit this patch to review:
https://gerrit.libreoffice.org/#/c/41086/

Winfried: thought you might be interested in reviewing this patch since you had added ScEncodeURL function, that's why I put you reviewer.
Comment 8 Commit Notification 2017-08-18 10:39:51 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=dabba2e3368c2e2ae4ab03ddcfc667e13f89841d

tdf#109104: respect RFC3986 for newlines in ScEncodeURL

It will be available in 6.0.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 9 Julien Nabet 2017-08-18 11:30:37 UTC
For 5.4 branch: https://gerrit.libreoffice.org/#/c/41278/
For 5.3 branch: https://gerrit.libreoffice.org/#/c/41279/
Comment 10 Commit Notification 2017-08-18 12:12:03 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=fdaee404f3216441d6b78636c0defae580f26034&h=libreoffice-5-3

tdf#109104: respect RFC3986 for newlines in ScEncodeURL

It will be available in 5.3.6.

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

Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2017-08-18 12:12:14 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6abbad3c44809d9f8116992475c5efcaafc23dbf&h=libreoffice-5-4

tdf#109104: respect RFC3986 for newlines in ScEncodeURL

It will be available in 5.4.2.

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

Affected users are encouraged to test the fix and report feedback.
Comment 12 Xavier Van Wijmeersch 2017-08-19 10:59:07 UTC
confirm its working

Version: 6.0.0.0.alpha0+
Build ID: e64a54acfea031d45b06b4c9d606fc03bfcbf40b
CPU threads: 8; OS: Linux 4.9; UI render: default; VCL: kde4; 
Locale: nl-BE (en_US.UTF-8); Calc: group