[okular] [Bug 426976] Okular mangles url fragment if the it contains a '.'

Albert Astals Cid bugzilla_noreply at kde.org
Thu Nov 26 10:55:12 GMT 2020


https://bugs.kde.org/show_bug.cgi?id=426976

Albert Astals Cid <aacid at kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
      Latest Commit|                            |https://invent.kde.org/grap
                   |                            |hics/okular/commit/239827ba
                   |                            |ad0301d578a861be55d5711d82c
                   |                            |c2048
             Status|ASSIGNED                    |RESOLVED

--- Comment #6 from Albert Astals Cid <aacid at kde.org> ---
Git commit 239827baad0301d578a861be55d5711d82cc2048 by Albert Astals Cid.
Committed on 26/11/2020 at 10:07.
Pushed by aacid into branch 'release/20.12'.

Rework how we open urls that have a #

Previously if it was a remote url that had # and a . after the # we
assumed the url had no fragment and everything was filename.

We don't do that anymore, what we do now is try to open the url as
parsed, i.e. before the # is the filename after is the fragment, and if
that fails we try to open everything as filename and nothing as
fragment.

Unfortunately given how kpart internals handle opening local vs remote
urls we need to do this in two places.

Also we have to remove the test that checked that the url was mangled at
the shell level because we don't do that anymore. Unfortunately can't
add a test for the new codepage since it would involve starting an http
server ^_^

Filenames:
  source2e.pdf
  foo#bar.pdf

What works:
 * okular http://localhost/source2e.pdf#subsection.68.3
 * okular file:///srv/http/source2e.pdf#subsection.68.3
 * okular source2e.pdf#subsection.68.3 (in the /srv/http folder)
 * okular source2e.pdf#2
 * okular http://localhost/foo#bar.pdf
 * okular file:///srv/http/foo#bar.pdf
 * okular foo#bar.pdf (in the /srv/http folder)

What doesn't work:
 * okular http://localhost/foo#bar.pdf#2

I think it's a fair limitation that if you want to open a file that contains #
in the name and also use a # page marker you need to use the encoded url like
okular http://localhost/foo%23bar.pdf#2
after all things like firefox will totally fail opening
http://localhost/foo#bar.pdf and will just work if you give the encoded url

M  +0    -6    autotests/shelltest.cpp
M  +22   -5    part/part.cpp
M  +6    -0    part/part.h
M  +0    -7    shell/shellutils.cpp

https://invent.kde.org/graphics/okular/commit/239827baad0301d578a861be55d5711d82cc2048

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Okular-devel mailing list