0
0
mirror of https://dev.sigpipe.me/dashie/git.txt synced 2025-10-06 02:22:41 +02:00

_ are now unstripped from filenames

This commit is contained in:
Dashie
2018-03-08 07:49:26 +01:00
parent fd0a8762c8
commit 03058b0a60
2 changed files with 5 additions and 5 deletions

View File

@@ -10,7 +10,7 @@
** TODO Cleanup gogs imports of unused bits
** TODO Add a field "filesystem filename" to add a real path to the gist file
** TODO Should spawn an error if filename contains '/'
** TODO _ shouldn't be stripped from filenames
** DONE _ shouldn't be stripped from filenames
** DONE Creation date on gitxt view
** DONE Count of current gitxt
** DONE Count of total managed gitxt

View File

@@ -6,10 +6,10 @@ package sanitize
*/
import (
"strings"
"bytes"
"path"
"regexp"
"bytes"
"strings"
)
// A very limited list of transliterations to catch common european names translated to urls.
@@ -133,7 +133,7 @@ func cleanString(s string, r *regexp.Regexp) string {
}
// We are very restrictive as this could be intended for ascii url slugs
var illegalPath = regexp.MustCompile(`[^[:alnum:]\~\-\./]`)
var illegalPath = regexp.MustCompile(`[^[:alnum:]\~\-\_\./]`)
// Filename will clean illegal characters
func Filename(s string) string {
@@ -145,4 +145,4 @@ func Filename(s string) string {
// NB this may be of length 0, caller must check
return filePath
}
}