Procházet zdrojové kódy

permit dot inside collection name, but not as first char, fixes https://github.com/Kozea/Radicale/issues/1632

Peter Bieringer před 1 rokem
rodič
revize
c2013ec901
1 změnil soubory, kde provedl 4 přidání a 2 odebrání
  1. 4 2
      radicale/web/internal_data/fn.js

+ 4 - 2
radicale/web/internal_data/fn.js

@@ -1348,8 +1348,10 @@ function cleanHREFinput(a) {
         href_form = a.target;
     }
     let currentTxtVal = href_form.value.trim().toLowerCase();
-    //Clean the HREF to remove non lowercase letters and dashes
-    currentTxtVal = currentTxtVal.replace(/(?![0-9a-z\-\_])./g, '');
+    //Clean the HREF to remove not permitted chars
+    currentTxtVal = currentTxtVal.replace(/(?![0-9a-z\-\_\.])./g, '');
+    //Clean the HREF to remove leading . (would result in hidden directory)
+    currentTxtVal = currentTxtVal.replace(/^\./, '');
     href_form.value = currentTxtVal;
 }