From 570f375b2f0cebfd9d08320c7ce97f7d68e26fb4 Mon Sep 17 00:00:00 2001
From: jonasled <jonas@jonasled.de>
Date: Tue, 25 Feb 2020 20:25:51 +0100
Subject: [PATCH] fixed ' character in shorten links, when deleting

---
 userprofile.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/userprofile.py b/userprofile.py
index d4f6737..f415573 100644
--- a/userprofile.py
+++ b/userprofile.py
@@ -32,7 +32,7 @@ def userProfile(request, cookieNotice, s, pageNumber, url_scheme):
                     calls = str(cursor2.execute('SELECT CALLS FROM ANALYTICS WHERE SHORT_URL=?', [entries[1]]).fetchone()[0])
                 except:
                     calls = "0"
-                response = response + "<tr id=tr_" + str(idCounter) + ">\n<td>" + entries[0] + "</td>\n<td><a href=\"" + url_scheme + "://" + entries[1] + '">' + entries[1] + '</a></td>\n<td>' + calls + '</td>\n<td><a id="red" href="javascript:deleteLink(\'/user/delete?link=' + escape(entries[1]) + '\',\'tr_' + str(idCounter) + '\')">delete</a> <a href="#" id="dialog-link" onclick="buttonListener(\'' + entries[1] + '\', this)">QR</a></tr>\n'
+                response = response + "<tr id=tr_" + str(idCounter) + ">\n<td>" + entries[0] + "</td>\n<td><a href=\"" + url_scheme + "://" + entries[1] + '">' + entries[1] + '</a></td>\n<td>' + calls + '</td>\n<td><a id="red" href="javascript:deleteLink(\'/user/delete?link=' + escape(entries[1].replace("'", "\\'")) + '\',\'tr_' + str(idCounter) + '\')">delete</a> <a href="#" id="dialog-link" onclick="buttonListener(\'' + entries[1] + '\', this)">QR</a></tr>\n'
                 idCounter=idCounter+1
             response = response + "</table>" #Close the table
 
-- 
GitLab