Skip to content

Commit

Permalink
Merge pull request #226 from yast/fix_spaces_encoding
Browse files Browse the repository at this point in the history
Fix spaces encoding
  • Loading branch information
jreidinger committed Feb 1, 2017
2 parents d413a36 + bd4e1a2 commit b3965fc
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -5,7 +5,7 @@ before_install:
# disable rvm, use system Ruby
- rvm reset
- wget https://raw.githubusercontent.com/yast/yast-devtools/master/travis-tools/travis_setup.sh
- sh ./travis_setup.sh -p "rake yast2-devtools yast2-testsuite yast2 yast2-pkg-bindings yast2-country-data yast2-storage" -g "rspec:3.3.0 yast-rake simplecov coveralls"
- sh ./travis_setup.sh -p "rake yast2-devtools yast2-testsuite yast2 yast2-pkg-bindings yast2-country-data yast2-storage" -g "rspec:3.3.0 yast-rake coveralls"
script:
- make -f Makefile.cvs
- make
Expand Down
7 changes: 7 additions & 0 deletions package/yast2-packager.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Feb 1 16:03:24 UTC 2017 - jreidinger@suse.com

- Fix escaping spaces ( yast uses web form escaping to "+" but
libzypp expects percentage escaping to "%20" ) (bsc#954813)
- 3.1.121

-------------------------------------------------------------------
Mon Jan 30 10:57:14 UTC 2017 - igonzalezsosa@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-packager.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-packager
Version: 3.1.120
Version: 3.1.121
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
4 changes: 3 additions & 1 deletion src/modules/SourceDialogs.rb
Expand Up @@ -343,7 +343,9 @@ def PostprocessISOURL(url)
params["url"] = URI.unescape(new_url.to_s)

processed = URI("")
processed.query = URI.encode_www_form(params)
# libzypp do not use web encoding as in https://www.w3.org/TR/html5/forms.html#url-encoded-form-data
# but percentage enconding only. For more details see (bsc#954813#c20)
processed.query = URI.encode_www_form(params).gsub(/\+/, "%20")

ret = "iso:///" + processed.to_s
log.info "Updated URL: #{URL.HidePassword(ret)}"
Expand Down
2 changes: 1 addition & 1 deletion test/source_dialogs_test.rb
Expand Up @@ -68,7 +68,7 @@

it "prevents double escaping if get already escaped string" do
converted = "iso:///install/Duomenys%20600%20GB/openSUSE-13.2-DVD-x86_64.iso"
url = "iso:///?iso=openSUSE-13.2-DVD-x86_64.iso&url=dir%3A%2Finstall%2FDuomenys+600+GB"
url = "iso:///?iso=openSUSE-13.2-DVD-x86_64.iso&url=dir%3A%2Finstall%2FDuomenys%20600%20GB"

expect(subject.PostprocessISOURL(converted)).to eq(url)
end
Expand Down

0 comments on commit b3965fc

Please sign in to comment.