From e5541155bdd9bdfa434e2b1261bf17deb027c427 Mon Sep 17 00:00:00 2001
From: Jonas Leder <jonas@jonasled.de>
Date: Tue, 9 Nov 2021 12:22:31 +0100
Subject: [PATCH] fix path not defined

---
 js/customElements/newComment.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/js/customElements/newComment.js b/js/customElements/newComment.js
index 0080b3e..1523128 100644
--- a/js/customElements/newComment.js
+++ b/js/customElements/newComment.js
@@ -14,7 +14,7 @@ class newComment extends HTMLElement {
         script.src = "https://hCaptcha.com/1/api.js";
         script.type = 'text/javascript';
         script.onload = () => {
-            let pageName = path.split("/").pop();
+            let pageName = window.location.pathname.split("/").pop();
             this.parentElement.innerHTML = ` 
                 <form action="/API/newComment.php" method="post">
                     <label for="name">Name:</label><br>
-- 
GitLab