Bug 408632 - kde-open functions incorrectly when given a URL with a port (opens a URL with port as the line number)
Summary: kde-open functions incorrectly when given a URL with a port (opens a URL with...
Status: RESOLVED FIXED
Alias: None
Product: kde-cli-tools
Classification: Plasma
Component: general (show other bugs)
Version: 5.16.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Aleix Pol
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-13 04:23 UTC by BugShelf
Modified: 2019-07-20 20:27 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description BugShelf 2019-06-13 04:23:21 UTC
SUMMARY

When using `kde-open`/`xdg-open` under Plasma 5.16, giving it a url such as `http://localhost:3000` will cause it to open `http://localhost/?line=3000&column=0` in the web browser.


STEPS TO REPRODUCE
1. Run `xdg-open http://localhost:3000`
2. Check the URL that was opened in the browser

OBSERVED RESULT

The URL `http://localhost/?line=3000&column=0` (port number translated to line number incorrectly) is opened in the web browser.


EXPECTED RESULT

The given URL (`http://localhost:3000`) should be opened in the web browser. 


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux
KDE Plasma Version: 5.16.0
KDE Frameworks Version: 5.59.0
Qt Version: 5.12.3

ADDITIONAL INFORMATION
Comment 1 Rex Dieter 2019-06-13 15:31:49 UTC
kde-open5 works as expected for me, I cannot reproduce what's reported here.

I'm testing kde-cli-tools-5.15.5, so possible this may be a 5.16 regression
Comment 2 Christoph Feck 2019-06-13 17:45:49 UTC
Yes, caused by the commit from bug 398998.
Comment 3 BugShelf 2019-06-13 20:57:32 UTC
Can confirm it used to work as expected in 5.15, only encountered this issue after an upgrade to 5.16. 

Looking at the referenced bug, perhaps this behavior should be limited to the `file` protocol - I'm assuming it was unintentional to have this apply to HTTP/FTP/etc.
Comment 4 Pit 2019-07-17 10:33:44 UTC
So why is nothing happening there?  This BUG is really annoying and breaks other applications that want/need to open web links in a browser.
Comment 5 Gleb Popov 2019-07-18 09:04:48 UTC
It turned out, that `xdg-open http://localhost:3000/` works, while `xdg-open http://localhost:3000` doesn't.

I've created a Phab diff fixing the issue: http://phabricator.kde.org/D22525
Comment 6 Gleb Popov 2019-07-20 15:20:50 UTC
Git commit 6d86fd453417464509860b7be8c3cbf0e4a8d27b by Gleb Popov.
Committed on 20/07/2019 at 15:19.
Pushed by arrowdodger into branch 'master'.

kioclient: Don't convert `:x:y` to `?line=x&column=y` for URLs starting with remote schemes.

Test Plan: `kioclient5 exec http://localhost:9000` now works correctly.

Subscribers: plasma-devel, #frameworks

Differential Revision: https://phabricator.kde.org/D22525

M  +9    -0    kioclient/urlinfo.h

https://commits.kde.org/kde-cli-tools/6d86fd453417464509860b7be8c3cbf0e4a8d27b
Comment 7 David Faure 2019-07-20 20:27:20 UTC
Git commit 42ef318a9d1c454f96b60181d8231a59233720ea by David Faure, on behalf of Gleb Popov.
Committed on 20/07/2019 at 20:27.
Pushed by dfaure into branch 'Plasma/5.16'.

kioclient: Don't convert `:x:y` to `?line=x&column=y` for URLs starting with remote schemes.

Test Plan: `kioclient5 exec http://localhost:9000` now works correctly.

Subscribers: plasma-devel, #frameworks

Differential Revision: https://phabricator.kde.org/D22525

M  +9    -0    kioclient/urlinfo.h

https://commits.kde.org/kde-cli-tools/42ef318a9d1c454f96b60181d8231a59233720ea