* gnus-html.el (gnus-html-get-image-data): Search also for \r\n\r\n to
get the start of data.
+ (gnus-html-encode-url): Add this function to encode special chars in
+ URL.
+ (gnus-html-wash-images): Use gnus-html-encode-url to encode URL.
+ (gnus-html-prefetch-images): Use gnus-html-encode-url to encode URL.
* gnus-group.el (gnus-group-update-hook): Call gnus-group-add-icon by
default.
(require 'url)
(require 'url-cache)
(require 'xml)
+(require 'browse-url)
(defcustom gnus-html-image-cache-ttl (days-to-time 7)
"Time in seconds used to cache the image on disk."
(define-key map [tab] 'widget-forward)
map))
+(defun gnus-html-encode-url (url)
+ "Encode URL."
+ (browse-url-url-encode-chars url "[)$ ]"))
+
(defun gnus-html-cache-expired (url ttl)
"Check if URL is cached for more than TTL."
(cond (url-standalone-mode
(delete-region (match-beginning 0) (match-end 0)))
(setq end (point))
(when (string-match "src=\"\\([^\"]+\\)" parameters)
- (setq url (match-string 1 parameters))
+ (setq url (gnus-html-encode-url (match-string 1 parameters)))
(gnus-message 8 "gnus-html-wash-tags: fetching image URL %s" url)
(if (string-match "^cid:\\(.*\\)" url)
;; URLs with cid: have their content stashed in other
gnus-blocked-images)))
(save-match-data
(while (re-search-forward "<img.*src=[\"']\\([^\"']+\\)" nil t)
- (let ((url (match-string 1)))
+ (let ((url (gnus-html-encode-url (match-string 1))))
(unless (gnus-html-image-url-blocked-p url blocked-images)
(when (gnus-html-cache-expired url gnus-html-image-cache-ttl)
(gnus-html-schedule-image-fetching nil