emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 40621e7: Transform non-restrictive domains to punyc


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 40621e7: Transform non-restrictive domains to punycode for display
Date: Wed, 30 Dec 2015 08:59:44 +0000

branch: master
commit 40621e704d5180c39880820234b01034c241204f
Author: Lars Magne Ingebrigtsen <address@hidden>
Commit: Lars Magne Ingebrigtsen <address@hidden>

    Transform non-restrictive domains to punycode for display
    
    * lisp/net/eww.el (eww): Check whether the domain is Highly
    Restrictive in the Unicode IDNA sense.
---
 lisp/net/eww.el |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 7ec58f1..88dfb02 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -275,6 +275,13 @@ word(s) will be searched for via `eww-search-prefix'."
            (setq url (concat eww-search-prefix
                              (replace-regexp-in-string " " "+" url))))))
   (eww-setup-buffer)
+  ;; Check whether the domain only uses "Highly Restricted" Unicode
+  ;; IDNA characters.  If not, transform to punycode to indicate that
+  ;; there may be funny business going on.
+  (let ((parsed (url-generic-parse-url url)))
+    (unless (puny-highly-restrictive-p (url-host parsed))
+      (setf (url-host parsed) (puny-encode-domain (url-host parsed)))
+      (setq url (url-recreate-url parsed))))
   (plist-put eww-data :url url)
   (plist-put eww-data :title "")
   (eww-update-header-line-format)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]