aboutsummaryrefslogtreecommitdiff
path: root/static/js
diff options
context:
space:
mode:
authorFChannel <=>2021-02-23 19:21:43 -0800
committerFChannel <=>2021-02-23 19:21:43 -0800
commitbbb1b82c5b5bc9c7e9cd96c41aa8339a95e49864 (patch)
tree74b4a5277a2a5fd4da7565777efafec2db0d53b1 /static/js
parent28e256f18f96d9afdcb903b3bc3daf93747c2195 (diff)
added fix for special characters in board name, also escaped some characters for regex. might be some missing edge cases
Diffstat (limited to 'static/js')
-rw-r--r--static/js/posts.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/static/js/posts.js b/static/js/posts.js
index 1cb032e..d6395e2 100644
--- a/static/js/posts.js
+++ b/static/js/posts.js
@@ -24,10 +24,9 @@ function getMIMEType(type)
function shortURL(actorName, url)
{
- var check = url.replace(actorName + "/", "")
re = /.+\//g;
temp = re.exec(url)
-
+
if(stripTransferProtocol(temp[0]) == stripTransferProtocol(actorName) + "/")
{
var short = url.replace("https://", "");
@@ -57,11 +56,13 @@ function shortURL(actorName, url)
u = re.exec(short);
+ str = short.replace(/\/+/g, " ")
+
+ str = str.replace(u, " ").trim()
- replace = short.replace(/\/+/g, " ")
- replace = replace.replace(u, " ").trim()
- re = /\w+$/;
- v = re.exec(replace)
+ re = /(\w|[!@#$%^&*<>])+$/;
+
+ v = re.exec(str)
v = "f" + v[0] + "-" + u