Closed dgdavid closed 3 years ago
For the future I'd suggest to drop the "Edit Parts of the URL" feature completely. I guess in most cases the users just copy&paste a whole URL anyway. Building URLs manually from separate parts is a bit overkill IMHO and not used much. If you need to edit the URL you can edit whole URL, just like in a web browser...
Problem
When editing a repository using the "Edit Parts of the URL" mode, YaST does not handle the dollar sign properly (escaping it to "%24").
Solution
Just include
$
intoURLRecode.PATH_SAFE_CHARS
.I evaluated (and discarded) the possibility to refactor
URLRecode
for making it RFC3986 compliant, but it does not pay off.Notes
Adding changes from SP1 on
Having a look at skelcds it could be checked that
$releasever
was used from openSUSE Leap 15.1 on. That's why the change is going to be included in SLE-15-SP1+ branches.Revisiting URI parts
Allowed chars for the URI path according to RFC3986
As the RFC states (see Appendix A for a quick view), an already percentage encoded (
%\h\h
) and/a-zA-Z0-9-._~!$&'()*+,;=:@
are perfectly valid chars for the URI path. This can be expressed with below regexpHowever, refactoring
URLRecode
for being compliant with RFC3986 not only when escaping thepath
but when doing so foruserinfo
andquery
is not as easy as it might appear at first sight. Furthermore, is not even necessary for the limited YaST URI handling so far.Discouraging the use of
URLRecode
(2021-07-28)We have added a kind of deprecation note from SLE-15-SP3 on, where a
Y2Packager::ZyppUrl
class was added for dealing with libzypp urls. See https://github.com/yast/yast-yast2/pull/1190 and https://github.com/yast/yast-yast2/pull/1191Tests
$
is not being escaped byURLRecode.EscapePath
MR: https://build.suse.de/request/show/245221 (after fixing a broken test in #1185)