diff options
| author | martianh <martianh@noreply.codeberg.org> | 2022-12-26 05:30:58 +0000 | 
|---|---|---|
| committer | martianh <martianh@noreply.codeberg.org> | 2022-12-26 05:30:58 +0000 | 
| commit | 01ba30fd8649e4048ddd7d6cb3f644dd5d02edff (patch) | |
| tree | 19c6a71d0b5b12ade04f1dcdb62de4a96fcfb2db | |
| parent | 54273449e5fb07fcf6e600eb872b4fcc76b60130 (diff) | |
| parent | 599cd053cdf4104c1739c40024a6586646a61eb4 (diff) | |
Merge branch 'develop' into fix-two-spaces-in-reply
| -rw-r--r-- | lisp/mastodon-auth.el | 1 | ||||
| -rw-r--r-- | lisp/mastodon-toot.el | 20 | 
2 files changed, 14 insertions, 7 deletions
diff --git a/lisp/mastodon-auth.el b/lisp/mastodon-auth.el index 263ece2..3de2901 100644 --- a/lisp/mastodon-auth.el +++ b/lisp/mastodon-auth.el @@ -137,6 +137,7 @@ When ASK is absent return nil."    (let ((url (mastodon-auth--get-browser-login-url))          authorization-code)      (kill-new url) +    (message "%s" url)      (setq authorization-code            (mastodon-auth--show-notice mastodon-auth--explanation                                        "*mastodon-notice*" diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 1917b7b..eab0dfd 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -610,13 +610,19 @@ To use the downloaded emoji, run `mastodon-toot--enable-custom-emoji'."        (unless (file-directory-p mastodon-custom-emoji-dir)          (make-directory mastodon-custom-emoji-dir nil)) ; no add parent        (mapc (lambda (x) -              (url-copy-file (alist-get 'url x) -                             (concat -                              mastodon-custom-emoji-dir -                              (alist-get 'shortcode x) -                              "." -                              (file-name-extension (alist-get 'url x))) -                             t)) +              (let ((url (alist-get 'url x)) +                    (shortcode (alist-get 'shortcode x))) +                ;; skip anything that contains unexpected characters +                (when (and url shortcode +                           (string-match-p "^[a-zA-Z0-9-_]+$" shortcode) +                           (string-match-p "^[a-zA-Z]+$" (file-name-extension url))) +                  (url-copy-file url +                                 (concat +                                  mastodon-custom-emoji-dir +                                  shortcode +                                  "." +                                  (file-name-extension url)) +                                 t))))              custom-emoji)        (message "Custom emoji for %s downloaded to %s"                 mastodon-instance-url  | 
