ソースを参照

[minor] Unicode issue in quote url

version-14
Anand Doshi 10年前
コミット
08d94920f6
1個のファイルの変更1行の追加1行の削除
  1. +1
    -1
      frappe/utils/data.py

+ 1
- 1
frappe/utils/data.py ファイルの表示

@@ -580,7 +580,7 @@ def expand_relative_urls(html):
def quote_urls(html):
def _quote_url(match):
groups = list(match.groups())
groups[2] = urllib.quote(groups[2], safe="~@#$&()*!+=:;,.?/'")
groups[2] = urllib.quote(groups[2].encode("utf-8"), safe=b"~@#$&()*!+=:;,.?/'").decode("utf-8")
return "".join(groups)
return re.sub('(href|src){1}([\s]*=[\s]*[\'"]?)((?:http)[^\'">]+)([\'"]?)',
_quote_url, html)


読み込み中…
キャンセル
保存