aboutsummaryrefslogtreecommitdiffhomepage
path: root/utilities.lisp
diff options
context:
space:
mode:
authorGrant Shangreaux <grant@unabridgedsoftware.com>2023-01-08 16:01:48 -0600
committerGrant Shangreaux <grant@unabridgedsoftware.com>2023-01-08 16:01:48 -0600
commit040a7dc9970f1f402d99934f5cd5398bde4f28f8 (patch)
tree5b518703fb9cc6d293db6dc422a0ff2474f83250 /utilities.lisp
parent08e561b5e876eac0f28126a953986bea53d0d111 (diff)
Clean: code review feedback Add: extra filename cleaning
Removes the legion cluster for zipping and just uses inline zipping in a thunk before adding the link element to the DOM. Cleans more characters from filenames for the zip file. Ensures there aren't errors around deleting the zip file if it isn't there.
Diffstat (limited to 'utilities.lisp')
-rw-r--r--utilities.lisp5
1 files changed, 3 insertions, 2 deletions
diff --git a/utilities.lisp b/utilities.lisp
index 0e258b6..a7e90e4 100644
--- a/utilities.lisp
+++ b/utilities.lisp
@@ -128,5 +128,6 @@
(apply then args)
(apply else args))))
-(defun clean-slashes (str)
- (cl-ppcre:regex-replace-all "/" str "-"))
+(defun clean-filename (str)
+ (let ((non-safe-chars (cl-ppcre:create-scanner "[^a-zA-Z0-9_\\-.]")))
+ (cl-ppcre:regex-replace-all non-safe-chars str "-")))