diff options
author | Ihor Radchenko <yantar92@posteo.net> | 2024-02-20 14:59:20 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2024-03-24 08:41:10 -0400 |
commit | 2bc865ace050ff118db43f01457f95f95112b877 (patch) | |
tree | dd9fdb80bc184b53b31d211948aa9224f1bd5142 /lisp | |
parent | 6f9ea396f49cbe38c2173e0a72ba6af3e03b271c (diff) | |
download | emacs-2bc865ace050ff118db43f01457f95f95112b877.tar.gz emacs-2bc865ace050ff118db43f01457f95f95112b877.tar.bz2 emacs-2bc865ace050ff118db43f01457f95f95112b877.zip |
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.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/org/org.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/org/org.el b/lisp/org/org.el index 0f5d17deee2..76559c91cd3 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -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) |