forked from Ponysearch/Ponysearch
Merge pull request #180 from return42/unicode-url
[fix] decoding of saved preferences in the URL
This commit is contained in:
commit
b2da675e27
2 changed files with 4 additions and 4 deletions
|
@ -437,10 +437,10 @@ class Preferences:
|
||||||
|
|
||||||
def parse_encoded_data(self, input_data):
|
def parse_encoded_data(self, input_data):
|
||||||
"""parse (base64) preferences from request (``flask.request.form['preferences']``)"""
|
"""parse (base64) preferences from request (``flask.request.form['preferences']``)"""
|
||||||
decoded_data = decompress(urlsafe_b64decode(input_data.encode()))
|
bin_data = decompress(urlsafe_b64decode(input_data))
|
||||||
dict_data = {}
|
dict_data = {}
|
||||||
for x, y in parse_qs(decoded_data).items():
|
for x, y in parse_qs(bin_data.decode('ascii')).items():
|
||||||
dict_data[x.decode()] = y[0].decode()
|
dict_data[x] = y[0]
|
||||||
self.parse_dict(dict_data)
|
self.parse_dict(dict_data)
|
||||||
|
|
||||||
def parse_dict(self, input_data):
|
def parse_dict(self, input_data):
|
||||||
|
|
|
@ -1456,7 +1456,7 @@ engines:
|
||||||
timeout: 5.0
|
timeout: 5.0
|
||||||
disabled: true
|
disabled: true
|
||||||
|
|
||||||
- name: slownik jezyka polskiego
|
- name: słownik języka polskiego
|
||||||
engine: sjp
|
engine: sjp
|
||||||
shortcut: sjp
|
shortcut: sjp
|
||||||
base_url: https://sjp.pwn.pl/
|
base_url: https://sjp.pwn.pl/
|
||||||
|
|
Loading…
Reference in a new issue