From 4bac1e1761328ab9a13d4c625548c98fd763ec9d Mon Sep 17 00:00:00 2001 From: gered Date: Sun, 6 Apr 2014 14:40:40 -0400 Subject: [PATCH] only accept lowercase characters in names --- src/toascii/models/art.clj | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/toascii/models/art.clj b/src/toascii/models/art.clj index be77ccd..91fabec 100644 --- a/src/toascii/models/art.clj +++ b/src/toascii/models/art.clj @@ -9,7 +9,7 @@ (defn valid-name? [name] (if-not (nil? name) - (re-matches #"[A-Za-z0-9\-]+" name))) + (re-matches #"[a-z0-9\-]+" name))) (defn search [query] ) @@ -28,3 +28,9 @@ (throw (new Exception "Invalid name"))) (let [prepped-ascii (prep-ascii-art s)] (db/add-ascii-art name prepped-ascii ip))) + + +(add + "heLllo" + " _ _ _ \n | |__ ___ | | | | ___ \n | '_ \\ / _ \\ | | | | / _ \\ \n | | | | | __/ | | | | | (_) |\n |_| |_| \\___| |_| |_| \\___/ \n " + "127.0.0.1")