mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-26 07:33:47 +00:00
org-file-contents: Consider all remote files unsafe
* lisp/org/org.el (org-file-contents): When loading files, consider all remote files (like TRAMP-fetched files) unsafe, in addition to URLs.
This commit is contained in:
parent
6f9ea396f4
commit
2bc865ace0
@ -4576,12 +4576,16 @@ from file or URL, and return nil.
|
||||
If NOCACHE is non-nil, do a fresh fetch of FILE even if cached version
|
||||
is available. This option applies only if FILE is a URL."
|
||||
(let* ((is-url (org-url-p file))
|
||||
(is-remote (condition-case nil
|
||||
(file-remote-p file)
|
||||
;; In case of error, be safe.
|
||||
(t t)))
|
||||
(cache (and is-url
|
||||
(not nocache)
|
||||
(gethash file org--file-cache))))
|
||||
(cond
|
||||
(cache)
|
||||
(is-url
|
||||
((or is-url is-remote)
|
||||
(if (org--should-fetch-remote-resource-p file)
|
||||
(condition-case error
|
||||
(with-current-buffer (url-retrieve-synchronously file)
|
||||
|
Loading…
Reference in New Issue
Block a user