From 040a7dc9970f1f402d99934f5cd5398bde4f28f8 Mon Sep 17 00:00:00 2001 From: Grant Shangreaux Date: Sun, 8 Jan 2023 16:01:48 -0600 Subject: 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. --- utilities.lisp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'utilities.lisp') 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 "-"))) -- cgit v1.2.3