mirror of https://codeberg.org/cage/tinmop/
- fixed text-utils:percent-encoded-p, an empty string is not percent-encoded;
- raised a better error when an empty string is entered as a gemini address.
This commit is contained in:
parent
66ba9d0b79
commit
1d850fffa4
|
@ -1018,6 +1018,8 @@
|
||||||
(when give-focus-to-message-window-p
|
(when give-focus-to-message-window-p
|
||||||
(ui:focus-to-message-window))
|
(ui:focus-to-message-window))
|
||||||
(cond
|
(cond
|
||||||
|
((text-utils:string-empty-p url)
|
||||||
|
(ui:error-message (_ "Empty address")))
|
||||||
((gemini-client:absolute-gemini-url-p url)
|
((gemini-client:absolute-gemini-url-p url)
|
||||||
(gemini-viewer:request url :use-cached-file-if-exists use-cached-file-if-exists))
|
(gemini-viewer:request url :use-cached-file-if-exists use-cached-file-if-exists))
|
||||||
((fs:dirp local-path)
|
((fs:dirp local-path)
|
||||||
|
|
|
@ -695,6 +695,9 @@ printed in the box column by column; in the example above the results are:
|
||||||
(percent-decode data)))
|
(percent-decode data)))
|
||||||
|
|
||||||
(defun percent-encoded-p (string)
|
(defun percent-encoded-p (string)
|
||||||
|
(if (string-empty-p string)
|
||||||
|
nil
|
||||||
|
(progn
|
||||||
(loop for i in (coerce string 'list)
|
(loop for i in (coerce string 'list)
|
||||||
for ct from 0 do
|
for ct from 0 do
|
||||||
(cond
|
(cond
|
||||||
|
@ -707,7 +710,7 @@ printed in the box column by column; in the example above the results are:
|
||||||
(percent:digitp (char-code i))
|
(percent:digitp (char-code i))
|
||||||
(percent:unreservedp (char-code i)))))
|
(percent:unreservedp (char-code i)))))
|
||||||
(return-from percent-encoded-p nil))))
|
(return-from percent-encoded-p nil))))
|
||||||
t)
|
t)))
|
||||||
|
|
||||||
(defun percent-encode-allow-null (data)
|
(defun percent-encode-allow-null (data)
|
||||||
(when data
|
(when data
|
||||||
|
|
Loading…
Reference in New Issue