diff --git a/src/main/frontend/util/fs.cljs b/src/main/frontend/util/fs.cljs index 2c60ced9e..be59e6919 100644 --- a/src/main/frontend/util/fs.cljs +++ b/src/main/frontend/util/fs.cljs @@ -130,6 +130,7 @@ gp-util/page-name-sanity ;; we want to preserve the case sensitive nature of most file systems, don't lowercase (string/replace gp-util/url-encoded-pattern encode-url-percent) ;; pre-encode % in title on demand (string/replace reserved-chars-pattern url-encode-file-name) + (string/replace #"^\." "%2E") ;; Force percent encoding to distinguish pages with a title starting with a dot from a hidden file. (escape-windows-reserved-filebodies) ;; do this before the lowbar encoding to avoid ambiguity (escape-namespace-slashes-and-multilowbars))) diff --git a/src/test/frontend/db/name_sanity_test.cljs b/src/test/frontend/db/name_sanity_test.cljs index 99863950a..5355171de 100644 --- a/src/test/frontend/db/name_sanity_test.cljs +++ b/src/test/frontend/db/name_sanity_test.cljs @@ -43,6 +43,7 @@ (test-page-name "dsa&;l dsalfjk jkl.") (test-page-name "hls__&;l dsalfjk jkl.") (test-page-name "CON.") + (test-page-name ".NET.") (mapv test-page-name fs-util/windows-reserved-filebodies)) (deftest new-path-computation-tests